Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- struct S<T>(T); trait Tr { } impl<T> Tr for S<T> { } fn foo<T: std::fmt::Debug>(t: T) -> impl Tr + std::fmt::Debug { S(t) }
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0277]: `main::S<T>` doesn't implement `std::fmt::Debug`
- --> src/main.rs:5:98
- |
- 5 | struct S<T>(T); trait Tr { } impl<T> Tr for S<T> { } fn foo<T: std::fmt::Debug>(t: T) -> impl Tr + std::fmt::Debug { S(t) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ `main::S<T>` cannot be formatted using `:?`; add `#[derive(Debug)]` or manually implement `std::fmt::Debug`
- |
- = help: the trait `std::fmt::Debug` is not implemented for `main::S<T>`
- = note: the return type of a function must have a statically known size
- error: aborting due to previous error
- 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