summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs')
-rw-r--r--src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs b/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs
new file mode 100644
index 000000000..86490c724
--- /dev/null
+++ b/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs
@@ -0,0 +1,15 @@
+struct Foo;
+
+trait Bar {}
+
+impl Bar for Foo {}
+
+fn needs_bar<T: Bar>(_: T) {}
+
+fn blah(f: fn() -> Foo) {
+ needs_bar(f);
+ //~^ ERROR the trait bound `fn() -> Foo: Bar` is not satisfied
+ //~| HELP use parentheses to call this function pointer
+}
+
+fn main() {}