Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. trait Trait {}
  2.  
  3. // Make sure casts between thin-pointer <-> fat pointer obey RFC401
  4. fn main() {
  5. let a: *mut (dyn Trait + 'static) = 0 as *mut _; //~ ERROR casting
  6. let b: *const str = 0 as *const str; //~ ERROR casting
  7.  
  8. let x: *mut (dyn Trait + 'static) = std::ptr::null_mut();
  9. let y: *const str = std::ptr::null();
  10. //~^ ERROR the size for values of type `str` cannot be known at compilation time
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement