]> git.proxmox.com Git - rustc.git/blob - src/test/ui/type-alias-impl-trait/assoc-type-lifetime.rs
New upstream version 1.41.1+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 #![feature(type_alias_impl_trait)]
6
7 trait UnwrapItemsExt {
8 type Iter;
9 fn unwrap_items(self) -> Self::Iter;
10 }
11
12 struct MyStruct {}
13
14 trait MyTrait<'a> {}
15
16 impl<'a> MyTrait<'a> for MyStruct {}
17
18 impl<'a, I> UnwrapItemsExt for I
19 where
20 {
21 type Iter = impl MyTrait<'a>;
22
23 fn unwrap_items(self) -> Self::Iter {
24 MyStruct {}
25 }
26 }
27
28 fn main() {}