Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- struct S; dbg!(S)
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0277]: `main::S` doesn't implement `std::fmt::Debug`
- --> src/main.rs:6:19
- |
- 6 | struct S; dbg!(S)
- | ^^^^^^^ `main::S` cannot be formatted using `{:?}`
- |
- = help: the trait `std::fmt::Debug` is not implemented for `main::S`
- = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug`
- = note: required because of the requirements on the impl of `std::fmt::Debug` for `&main::S`
- = note: required by `std::fmt::Debug::fmt`
- = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
- error[E0277]: `main::S` doesn't implement `std::fmt::Debug`
- --> src/main.rs:5:22
- |
- 5 | println!("{:?}", {
- | ______________________^
- 6 | | struct S; dbg!(S)
- 7 | | });
- | |_____^ `main::S` cannot be formatted using `{:?}`
- |
- = help: the trait `std::fmt::Debug` is not implemented for `main::S`
- = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug`
- = note: required by `std::fmt::Debug::fmt`
- error: aborting due to 2 previous errors
- For more information about this error, try `rustc --explain E0277`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment