2022-12-27 01:55:54 +00:00
|
|
|
error[E0277]: the trait bound `&Box<dyn Fn() -> i32>: Foo` is not satisfied
|
|
|
|
--> $DIR/call-on-unimplemented-with-autoderef.rs:8:15
|
|
|
|
|
|
|
|
|
LL | needs_foo(x);
|
|
|
|
| --------- ^ the trait `Foo` is not implemented for `&Box<dyn Fn() -> i32>`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
|
|
|
|
|
|
|
|
note: required by a bound in `needs_foo`
|
|
|
|
--> $DIR/call-on-unimplemented-with-autoderef.rs:5:22
|
|
|
|
|
|
|
|
|
LL | fn needs_foo(_: impl Foo) {}
|
|
|
|
| ^^^ required by this bound in `needs_foo`
|
|
|
|
help: use parentheses to call this trait object
|
|
|
|
|
|
|
|
|
LL | needs_foo(x());
|
|
|
|
| ++
|
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2022-12-27 01:55:54 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|