summaryrefslogtreecommitdiffstats
path: root/tests/ui/generic-associated-types/variance_constraints.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generic-associated-types/variance_constraints.rs')
-rw-r--r--tests/ui/generic-associated-types/variance_constraints.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/generic-associated-types/variance_constraints.rs b/tests/ui/generic-associated-types/variance_constraints.rs
new file mode 100644
index 000000000..0e9dbb8b1
--- /dev/null
+++ b/tests/ui/generic-associated-types/variance_constraints.rs
@@ -0,0 +1,22 @@
+// check-pass
+// issue #69184
+
+trait A {
+ type B<'a> where Self: 'a;
+
+ fn make_b<'a>(&'a self) -> Self::B<'a>;
+}
+
+struct S {}
+impl A for S {
+ type B<'a> = &'a S;
+ fn make_b<'a>(&'a self) -> &'a Self {
+ self
+ }
+}
+
+enum E<'a> {
+ S(<S as A>::B<'a>),
+}
+
+fn main() {}