the.bay.news

*const as *mut compiles but *const as *const does not

The Rust Programming Language Forum
*const as *mut compiles but *const as *const does not
Is this expected? use std::mem::ManuallyDrop; fn main() {} trait SomeTrait {} // Compiles fn func_1(x: *const ManuallyDrop<dyn SomeTrait>) -> *mut dyn SomeTrait { x as _ } // Does not compile fn func_2(x: *const ManuallyDrop<dyn SomeTrait>) -> *const dyn SomeTrait { x as _ }

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.