Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- (|x: Fn()| {})(&||{})
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0277]: the trait bound `std::ops::Fn() + 'static: std::marker::Sized` is not satisfied
- --> src/main.rs:5:11
- |
- 5 | (|x: Fn()| {})(&||{})
- | ^ `std::ops::Fn() + 'static` does not have a constant size known at compile-time
- |
- = help: the trait `std::marker::Sized` is not implemented for `std::ops::Fn() + 'static`
- = note: all local variables must have a statically known size
- error[E0308]: mismatched types
- --> src/main.rs:5:24
- |
- 5 | (|x: Fn()| {})(&||{})
- | ^^^^^ expected trait std::ops::Fn, found reference
- |
- = note: expected type `std::ops::Fn() + 'static`
- found type `&[closure@src/main.rs:5:25: 5:29]`
- error[E0277]: the trait bound `std::ops::Fn() + 'static: std::marker::Sized` is not satisfied in `(std::ops::Fn() + 'static,)`
- --> src/main.rs:5:9
- |
- 5 | (|x: Fn()| {})(&||{})
- | ^^^^^^^^^^^^^^^^^^^^^ `std::ops::Fn() + 'static` does not have a constant size known at compile-time
- |
- = help: within `(std::ops::Fn() + 'static,)`, the trait `std::marker::Sized` is not implemented for `std::ops::Fn() + 'static`
- = note: required because it appears within the type `(std::ops::Fn() + 'static,)`
- error: aborting due to 3 previous errors
- Some errors occurred: E0277, E0308.
- For more information about an error, try `rustc --explain E0277`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment