Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #![allow(unreachable_code)]
  2.  
  3.  
  4. fn main() {
  5. println!("{:?}", {
  6. use std::num::NonZeroU32; Some(unsafe { NonZero::new_unchecked('x' as u32) })
  7. });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12. Compiling playground v0.0.1 (/playground)
  13. error[E0433]: failed to resolve: use of undeclared type or module `NonZero`
  14. --> src/main.rs:6:49
  15. |
  16. 6 | use std::num::NonZeroU32; Some(unsafe { NonZero::new_unchecked('x' as u32) })
  17. | ^^^^^^^ use of undeclared type or module `NonZero`
  18.  
  19. warning: unused import: `std::num::NonZeroU32`
  20. --> src/main.rs:6:13
  21. |
  22. 6 | use std::num::NonZeroU32; Some(unsafe { NonZero::new_unchecked('x' as u32) })
  23. | ^^^^^^^^^^^^^^^^^^^^
  24. |
  25. = note: #[warn(unused_imports)] on by default
  26.  
  27. error: aborting due to previous error
  28.  
  29. For more information about this error, try `rustc --explain E0433`.
  30. error: Could not compile `playground`.
  31.  
  32. To learn more, run the command again with --verbose.
  33.  
  34. */
  35.  
  36. /* ~~~~=== stdout ===~~~~
  37.  
  38. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement