summaryrefslogtreecommitdiffstats
path: root/src/test/ui/late-bound-lifetimes/downgraded_to_early_through_alias.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/late-bound-lifetimes/downgraded_to_early_through_alias.rs')
-rw-r--r--src/test/ui/late-bound-lifetimes/downgraded_to_early_through_alias.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/late-bound-lifetimes/downgraded_to_early_through_alias.rs b/src/test/ui/late-bound-lifetimes/downgraded_to_early_through_alias.rs
new file mode 100644
index 000000000..e56a34218
--- /dev/null
+++ b/src/test/ui/late-bound-lifetimes/downgraded_to_early_through_alias.rs
@@ -0,0 +1,24 @@
+// check-pass
+
+trait Gats<'a> {
+ type Assoc;
+ type Assoc2;
+}
+
+trait Trait: for<'a> Gats<'a> {
+ fn foo<'a>(_: &mut <Self as Gats<'a>>::Assoc) -> <Self as Gats<'a>>::Assoc2;
+}
+
+impl<'a> Gats<'a> for () {
+ type Assoc = &'a u32;
+ type Assoc2 = ();
+}
+
+type GatsAssoc<'a, T> = <T as Gats<'a>>::Assoc;
+type GatsAssoc2<'a, T> = <T as Gats<'a>>::Assoc2;
+
+impl Trait for () {
+ fn foo<'a>(_: &mut GatsAssoc<'a, Self>) -> GatsAssoc2<'a, Self> {}
+}
+
+fn main() {}