Guest User

Untitled

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