summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs')
-rw-r--r--tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs b/tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs
new file mode 100644
index 000000000..cd05b7738
--- /dev/null
+++ b/tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs
@@ -0,0 +1,20 @@
+// run-rustfix
+
+trait Foo {}
+
+trait Bar {
+ fn hello(&self) {}
+}
+
+struct S;
+
+impl Foo for S {}
+impl Bar for S {}
+
+fn test(foo: impl Foo) {
+ foo.hello(); //~ ERROR E0599
+}
+
+fn main() {
+ test(S);
+}