rust/tests/ui/suggestions/call-on-unimplemented-with-autoderef.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
222 B
Rust
Raw Normal View History

trait Foo {}
impl Foo for i32 {}
fn needs_foo(_: impl Foo) {}
fn test(x: &Box<dyn Fn() -> i32>) {
needs_foo(x);
//~^ ERROR the trait bound
//~| HELP use parentheses to call this trait object
}
fn main() {}