about summary refs log tree commit diff
path: root/tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs
diff options
context:
space:
mode:
authorlong-long-float <niinikazuki@yahoo.co.jp>2024-01-25 23:15:54 +0900
committerlong-long-float <niinikazuki@yahoo.co.jp>2024-04-23 00:15:10 +0900
commit31e581ec1201aac9a3475b16d2100a3ddd35e2e3 (patch)
treef694f308c3d5e92358e5768bd8a3df5d3c266c7b /tests/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.rs
parent453ceafce32ef8108c604bca5e165ab41d3d6d8c (diff)
downloadrust-31e581ec1201aac9a3475b16d2100a3ddd35e2e3.tar.gz
rust-31e581ec1201aac9a3475b16d2100a3ddd35e2e3.zip
Wrap dyn type with parentheses in suggestion
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.rs13
1 files changed, 12 insertions, 1 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
index ab25b362fed..f49512bdd62 100644
--- 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
@@ -12,7 +12,18 @@ impl Foo for S {}
 impl Bar for S {}
 
 fn test(foo: impl Foo) {
-    foo.hello(); //~ ERROR E0599
+    foo.hello(); //~ ERROR no method named `hello` found
+}
+
+trait Trait {
+    fn method(&self) {}
+}
+
+impl Trait for fn() {}
+
+#[allow(dead_code)]
+fn test2(f: impl Fn() -> dyn std::fmt::Debug) {
+    f.method(); //~ ERROR no method named `method` found
 }
 
 fn main() {