Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. #![allow(unreachable_code)]
  2.  
  3.  
  4. fn main() {
  5. println!("{:?}", {
  6. unsafe {std::mem::transmute""<(usize, usize)>(&mut [1u8; 2] as *mut [u8])}
  7. });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12. Compiling playground v0.0.1 (/playground)
  13. error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `""`
  14. --> src/main.rs:6:36
  15. |
  16. 6 | unsafe {std::mem::transmute""<(usize, usize)>(&mut [1u8; 2] as *mut [u8])}
  17. | ^^ expected one of 8 possible tokens here
  18.  
  19. error[E0277]: `unsafe extern "rust-intrinsic" fn(_) -> _ {std::mem::transmute::<_, _>}` doesn't implement `std::fmt::Debug`
  20. --> src/main.rs:5:22
  21. |
  22. 5 | println!("{:?}", {
  23. | ______________________^
  24. 6 | | unsafe {std::mem::transmute""<(usize, usize)>(&mut [1u8; 2] as *mut [u8])}
  25. 7 | | });
  26. | |_____^ `unsafe extern "rust-intrinsic" fn(_) -> _ {std::mem::transmute::<_, _>}` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
  27. |
  28. = help: the trait `std::fmt::Debug` is not implemented for `unsafe extern "rust-intrinsic" fn(_) -> _ {std::mem::transmute::<_, _>}`
  29. = note: required by `std::fmt::Debug::fmt`
  30.  
  31. error: aborting due to 2 previous errors
  32.  
  33. For more information about this error, try `rustc --explain E0277`.
  34. error: Could not compile `playground`.
  35.  
  36. To learn more, run the command again with --verbose.
  37.  
  38. */
  39.  
  40. /* ~~~~=== stdout ===~~~~
  41.  
  42. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement