]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/assoc-type-lifetime.rs
Rollup merge of #106732 - durin42:dmitrig-arrayref-ctor, r=nikic
[rust.git] / tests / 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<'a> {
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<'a> for I {
19     type Iter = impl MyTrait<'a>;
20
21     fn unwrap_items(self) -> Self::Iter {
22         MyStruct {}
23     }
24 }
25
26 fn main() {}