Guest User

Untitled

a guest
Jul 22nd, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. #![feature(specialization)]
  2.  
  3. fn main() {
  4. println!("{:?}", {
  5. use ::std::fmt::{Debug, Display}; trait Foo {} impl<T: Debug> Foo for T {} impl<T: Display> Foo for T {} impl<T: Debug + Display> Foo for T {}
  6. });
  7. }
  8.  
  9.  
  10. /* ~~~~=== stderr ===~~~~
  11. Compiling playground v0.0.1 (file:///playground)
  12. error[E0119]: conflicting implementations of trait `main::Foo`:
  13. --> src/main.rs:5:85
  14. |
  15. 5 | use ::std::fmt::{Debug, Display}; trait Foo {} impl<T: Debug> Foo for T {} impl<T: Display> Foo for T {} impl<T: Debug + Display> Foo for T {}
  16. | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
  17. | |
  18. | first implementation here
  19.  
  20. error: aborting due to previous error
  21.  
  22. For more information about this error, try `rustc --explain E0119`.
  23. error: Could not compile `playground`.
  24.  
  25. To learn more, run the command again with --verbose.
  26.  
  27. */
  28.  
  29. /* ~~~~=== stdout ===~~~~
  30.  
  31. */
Add Comment
Please, Sign In to add comment