Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. #![allow(unreachable_code)]
  2. #![feature(existential_type)]
  3.  
  4. fn main() {
  5. println!("{:?}", {
  6. fn foo() { } existential type Foo:; fn bar() -> Foo { foo } trait Tr { fn baz(&self) { } } impl Tr for Foo { } Tr::baz(&foo);
  7. });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12. Compiling playground v0.0.1 (/playground)
  13. error[E0277]: the trait bound `fn() {main::foo}: main::Tr` is not satisfied
  14. --> src/main.rs:6:121
  15. |
  16. 6 | fn foo() { } existential type Foo:; fn bar() -> Foo { foo } trait Tr { fn baz(&self) { } } impl Tr for Foo { } Tr::baz(&foo);
  17. | ^^^^^^^ the trait `main::Tr` is not implemented for `fn() {main::foo}`
  18. |
  19. note: required by `main::Tr::baz`
  20. --> src/main.rs:6:81
  21. |
  22. 6 | fn foo() { } existential type Foo:; fn bar() -> Foo { foo } trait Tr { fn baz(&self) { } } impl Tr for Foo { } Tr::baz(&foo);
  23. | ^^^^^^^^^^^^^
  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. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement