Guest User

Untitled

a guest
May 26th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. fn main() {
  2. println!("{:?}", {
  3. #[derive(Debug)] struct S<T>(T); trait Tr { } impl<T> Tr for S<T> { } fn foo<T>(t: T) -> impl Tr { S(t) } foo(5)
  4. });
  5. }
  6.  
  7.  
  8. /* ~~~~=== stderr ===~~~~
  9. Compiling playground v0.0.1 (file:///playground)
  10. error[E0277]: `impl main::Tr` doesn't implement `std::fmt::Debug`
  11. --> src/main.rs:4:22
  12. |
  13. 4 | println!("{:?}", {
  14. | ______________________^
  15. 5 | | #[derive(Debug)] struct S<T>(T); trait Tr { } impl<T> Tr for S<T> { } fn foo<T>(t: T) -> impl Tr { S(t) } foo(5)
  16. 6 | | });
  17. | |_____^ `impl main::Tr` cannot be formatted using `:?` because it doesn't implement `std::fmt::Debug`
  18. |
  19. = help: the trait `std::fmt::Debug` is not implemented for `impl main::Tr`
  20. = note: required by `std::fmt::Debug::fmt`
  21.  
  22. error: aborting due to previous error
  23.  
  24. For more information about this error, try `rustc --explain E0277`.
  25. error: Could not compile `playground`.
  26.  
  27. To learn more, run the command again with --verbose.
  28.  
  29. */
  30.  
  31. /* ~~~~=== stdout ===~~~~
  32.  
  33. */
Add Comment
Please, Sign In to add comment