Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 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() { let _: Foo = foo; }
  7. });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12. Compiling playground v0.0.1 (/playground)
  13. error[E0308]: mismatched types
  14. --> src/main.rs:6:70
  15. |
  16. 6 | fn foo() { } existential type Foo:; fn bar() { let _: Foo = foo; }
  17. | ^^^ expected opaque type, found fn item
  18. |
  19. = note: expected type `Foo`
  20. found type `fn() {main::foo}`
  21.  
  22. error: could not find defining uses
  23. --> src/main.rs:6:23
  24. |
  25. 6 | fn foo() { } existential type Foo:; fn bar() { let _: Foo = foo; }
  26. | ^^^^^^^^^^^^^^^^^^^^^^
  27.  
  28. error: aborting due to 2 previous errors
  29.  
  30. For more information about this error, try `rustc --explain E0308`.
  31. error: Could not compile `playground`.
  32.  
  33. To learn more, run the command again with --verbose.
  34.  
  35. */
  36.  
  37. /* ~~~~=== stdout ===~~~~
  38.  
  39. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement