]> git.proxmox.com Git - rustc.git/blob - src/test/ui/rfc-2093-infer-outlives/issue-54467.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / rfc-2093-infer-outlives / issue-54467.rs
1 // Regression test for #54467:
2 //
3 // Here, the trait object has an "inferred outlives" requirement that
4 // `<Self as MyIterator<'a>>::Item: 'a`; but since we don't know what
5 // `Self` is, we were (incorrectly) messing things up, leading to
6 // strange errors. This test ensures that we do not give compilation
7 // errors.
8 //
9 // check-pass
10
11 trait MyIterator<'a>: Iterator where Self::Item: 'a { }
12
13 struct MyStruct<'a, A> {
14 item: Box<dyn MyIterator<'a, Item = A>>
15 }
16
17 fn main() { }