]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/call-on-unimplemented-with-autoderef.rs
Rollup merge of #106829 - compiler-errors:more-alias-combine, r=spastorino
[rust.git] / tests / ui / suggestions / call-on-unimplemented-with-autoderef.rs
1 trait Foo {}
2
3 impl Foo for i32 {}
4
5 fn needs_foo(_: impl Foo) {}
6
7 fn test(x: &Box<dyn Fn() -> i32>) {
8     needs_foo(x);
9     //~^ ERROR the trait bound
10     //~| HELP use parentheses to call this trait object
11 }
12
13 fn main() {}