Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #![allow(unreachable_code)]
  2.  
  3.  
  4. fn main() {
  5. println!("{:?}", {
  6. use serde::*; let t: Box<dyn Serialize> = unsafe { std::mem::uninitialized() }; 0
  7. });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12. Compiling playground v0.0.1 (/playground)
  13. error[E0038]: the trait `serde::ser::Serialize` cannot be made into an object
  14. --> src/main.rs:6:30
  15. |
  16. 6 | use serde::*; let t: Box<dyn Serialize> = unsafe { std::mem::uninitialized() }; 0
  17. | ^^^^^^^^^^^^^^^^^^ the trait `serde::ser::Serialize` cannot be made into an object
  18. |
  19. = note: method `serialize` has generic type parameters
  20.  
  21. error[E0038]: the trait `serde::ser::Serialize` cannot be made into an object
  22. --> src/main.rs:6:60
  23. |
  24. 6 | use serde::*; let t: Box<dyn Serialize> = unsafe { std::mem::uninitialized() }; 0
  25. | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `serde::ser::Serialize` cannot be made into an object
  26. |
  27. = note: method `serialize` has generic type parameters
  28.  
  29. error: aborting due to 2 previous errors
  30.  
  31. For more information about this error, try `rustc --explain E0038`.
  32. error: Could not compile `playground`.
  33.  
  34. To learn more, run the command again with --verbose.
  35.  
  36. */
  37.  
  38. /* ~~~~=== stdout ===~~~~
  39.  
  40. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement