summaryrefslogtreecommitdiffstats
path: root/tests/ui/self/self-in-typedefs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/self/self-in-typedefs.rs')
-rw-r--r--tests/ui/self/self-in-typedefs.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/ui/self/self-in-typedefs.rs b/tests/ui/self/self-in-typedefs.rs
new file mode 100644
index 000000000..81e557d53
--- /dev/null
+++ b/tests/ui/self/self-in-typedefs.rs
@@ -0,0 +1,38 @@
+// build-pass (FIXME(62277): could be check-pass?)
+#![allow(dead_code)]
+
+use std::mem::ManuallyDrop;
+
+enum A<'a, T: 'a>
+where
+ Self: Send, T: PartialEq<Self>
+{
+ Foo(&'a Self),
+ Bar(T),
+}
+
+struct B<'a, T: 'a>
+where
+ Self: Send, T: PartialEq<Self>
+{
+ foo: &'a Self,
+ bar: T,
+}
+
+union C<'a, T: 'a>
+where
+ Self: Send, T: PartialEq<Self>
+{
+ foo: &'a Self,
+ bar: ManuallyDrop<T>,
+}
+
+union D<'a, T: 'a>
+where
+ Self: Send, T: PartialEq<Self> + Copy
+{
+ foo: &'a Self,
+ bar: T,
+}
+
+fn main() {}