Guest User

Untitled

a guest
Jun 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. fn main() {
  2. println!("{:?}", {
  3. (|x: Fn()| {})(&||{})
  4. });
  5. }
  6.  
  7.  
  8. /* ~~~~=== stderr ===~~~~
  9. Compiling playground v0.0.1 (file:///playground)
  10. error[E0277]: the trait bound `std::ops::Fn() + 'static: std::marker::Sized` is not satisfied
  11. --> src/main.rs:5:11
  12. |
  13. 5 | (|x: Fn()| {})(&||{})
  14. | ^ `std::ops::Fn() + 'static` does not have a constant size known at compile-time
  15. |
  16. = help: the trait `std::marker::Sized` is not implemented for `std::ops::Fn() + 'static`
  17. = note: all local variables must have a statically known size
  18.  
  19. error[E0308]: mismatched types
  20. --> src/main.rs:5:24
  21. |
  22. 5 | (|x: Fn()| {})(&||{})
  23. | ^^^^^ expected trait std::ops::Fn, found reference
  24. |
  25. = note: expected type `std::ops::Fn() + 'static`
  26. found type `&[closure@src/main.rs:5:25: 5:29]`
  27.  
  28. error[E0277]: the trait bound `std::ops::Fn() + 'static: std::marker::Sized` is not satisfied in `(std::ops::Fn() + 'static,)`
  29. --> src/main.rs:5:9
  30. |
  31. 5 | (|x: Fn()| {})(&||{})
  32. | ^^^^^^^^^^^^^^^^^^^^^ `std::ops::Fn() + 'static` does not have a constant size known at compile-time
  33. |
  34. = help: within `(std::ops::Fn() + 'static,)`, the trait `std::marker::Sized` is not implemented for `std::ops::Fn() + 'static`
  35. = note: required because it appears within the type `(std::ops::Fn() + 'static,)`
  36.  
  37. error: aborting due to 3 previous errors
  38.  
  39. Some errors occurred: E0277, E0308.
  40. For more information about an error, try `rustc --explain E0277`.
  41. error: Could not compile `playground`.
  42.  
  43. To learn more, run the command again with --verbose.
  44.  
  45. */
  46.  
  47. /* ~~~~=== stdout ===~~~~
  48.  
  49. */
Add Comment
Please, Sign In to add comment