Guest User

Untitled

a guest
Jan 19th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. #![allow(unreachable_code)]
  2.  
  3.  
  4. fn main() {
  5. println!("{:?}", {
  6. struct S; dbg!(S)
  7. });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12. Compiling playground v0.0.1 (/playground)
  13. error[E0277]: `main::S` doesn't implement `std::fmt::Debug`
  14. --> src/main.rs:6:19
  15. |
  16. 6 | struct S; dbg!(S)
  17. | ^^^^^^^ `main::S` cannot be formatted using `{:?}`
  18. |
  19. = help: the trait `std::fmt::Debug` is not implemented for `main::S`
  20. = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug`
  21. = note: required because of the requirements on the impl of `std::fmt::Debug` for `&main::S`
  22. = note: required by `std::fmt::Debug::fmt`
  23. = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
  24.  
  25. error[E0277]: `main::S` doesn't implement `std::fmt::Debug`
  26. --> src/main.rs:5:22
  27. |
  28. 5 | println!("{:?}", {
  29. | ______________________^
  30. 6 | | struct S; dbg!(S)
  31. 7 | | });
  32. | |_____^ `main::S` cannot be formatted using `{:?}`
  33. |
  34. = help: the trait `std::fmt::Debug` is not implemented for `main::S`
  35. = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug`
  36. = note: required by `std::fmt::Debug::fmt`
  37.  
  38. error: aborting due to 2 previous errors
  39.  
  40. For more information about this error, try `rustc --explain E0277`.
  41. error: Could not compile `playground`.
  42.  
  43. To learn more, run the command again with --verbose.
  44.  
  45. */
  46.  
  47. /* ~~~~=== stdout ===~~~~
  48.  
  49. */
Add Comment
Please, Sign In to add comment