summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/call-on-unimplemented-with-autoderef.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/suggestions/call-on-unimplemented-with-autoderef.rs')
-rw-r--r--tests/ui/suggestions/call-on-unimplemented-with-autoderef.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/suggestions/call-on-unimplemented-with-autoderef.rs b/tests/ui/suggestions/call-on-unimplemented-with-autoderef.rs
new file mode 100644
index 000000000..9021dd752
--- /dev/null
+++ b/tests/ui/suggestions/call-on-unimplemented-with-autoderef.rs
@@ -0,0 +1,13 @@
+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() {}