aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/self-in-impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/rust/compile/self-in-impl.rs')
-rw-r--r--gcc/testsuite/rust/compile/self-in-impl.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/self-in-impl.rs b/gcc/testsuite/rust/compile/self-in-impl.rs
new file mode 100644
index 0000000..a567897
--- /dev/null
+++ b/gcc/testsuite/rust/compile/self-in-impl.rs
@@ -0,0 +1,15 @@
+// the error message here is what rustc >=1.66 emits
+// rustc <1.66 emits a "cycle detected" error when
+// trying to calculate the impl type
+//
+// since we aren't trying to match error messages too closely
+// and the >=1.66 error message is nicer
+// we may as well mimic that
+
+impl ((Self, i32)) {}
+// { dg-error ".Self. is not valid in the self" "" { target *-*-* } .-1 }
+
+trait Foo {}
+
+impl Foo for ((Self, i32)) {}
+// { dg-error ".Self. is not valid in the self" "" { target *-*-* } .-1 }