summary refs log tree commit diff
path: root/tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021-without-dyn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021-without-dyn.rs')
-rw-r--r--tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021-without-dyn.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021-without-dyn.rs b/tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021-without-dyn.rs
new file mode 100644
index 00000000000..10b4781eb04
--- /dev/null
+++ b/tests/ui/suggestions/dyn-incompatible-trait-should-use-self-2021-without-dyn.rs
@@ -0,0 +1,22 @@
+//@ edition:2021
+#![allow(bare_trait_objects)]
+trait A: Sized {
+    fn f(a: A) -> A;
+    //~^ ERROR expected a type, found a trait
+    //~| ERROR expected a type, found a trait
+    //~| ERROR associated item referring to unboxed trait object for its own trait
+}
+trait B {
+    fn f(b: B) -> B;
+    //~^ ERROR expected a type, found a trait
+    //~| ERROR expected a type, found a trait
+    //~| ERROR associated item referring to unboxed trait object for its own trait
+}
+trait C {
+    fn f(&self, c: C) -> C;
+    //~^ ERROR expected a type, found a trait
+    //~| ERROR expected a type, found a trait
+    //~| ERROR associated item referring to unboxed trait object for its own trait
+}
+
+fn main() {}