*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
No comments yet.