]> git.proxmox.com Git - rustc.git/blob - src/test/ui/type-alias-impl-trait/assoc-type-lifetime.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / assoc-type-lifetime.rs
1 // Tests that we still detect defining usages when
2 // lifetimes are used in an associated opaque type
3 // check-pass
4
5 // revisions: min_tait full_tait
6 #![feature(min_type_alias_impl_trait)]
7 #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
8 //[full_tait]~^ WARN incomplete
9
10 trait UnwrapItemsExt<'a> {
11 type Iter;
12 fn unwrap_items(self) -> Self::Iter;
13 }
14
15 struct MyStruct {}
16
17 trait MyTrait<'a> {}
18
19 impl<'a> MyTrait<'a> for MyStruct {}
20
21 impl<'a, I> UnwrapItemsExt<'a> for I {
22 type Iter = impl MyTrait<'a>;
23
24 fn unwrap_items(self) -> Self::Iter {
25 MyStruct {}
26 }
27 }
28
29 fn main() {}