]> git.proxmox.com Git - rustc.git/blame - tests/ui/type-alias-impl-trait/assoc-type-lifetime.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / tests / ui / type-alias-impl-trait / assoc-type-lifetime.rs
CommitLineData
60c5eb7d
XL
1// Tests that we still detect defining usages when
2// lifetimes are used in an associated opaque type
3// check-pass
4
353b0b11 5#![feature(impl_trait_in_assoc_type)]
60c5eb7d 6
74b04a01 7trait UnwrapItemsExt<'a> {
60c5eb7d
XL
8 type Iter;
9 fn unwrap_items(self) -> Self::Iter;
10}
11
12struct MyStruct {}
13
14trait MyTrait<'a> {}
15
16impl<'a> MyTrait<'a> for MyStruct {}
17
74b04a01 18impl<'a, I> UnwrapItemsExt<'a> for I {
60c5eb7d
XL
19 type Iter = impl MyTrait<'a>;
20
21 fn unwrap_items(self) -> Self::Iter {
22 MyStruct {}
23 }
24}
25
26fn main() {}