]> git.proxmox.com Git - rustc.git/blob - tests/ui/generic-associated-types/issue-86218.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / tests / ui / generic-associated-types / issue-86218.rs
1 // check-pass
2
3 #![feature(impl_trait_in_assoc_type)]
4
5 pub trait Stream {
6 type Item;
7 }
8
9 impl Stream for () {
10 type Item = i32;
11 }
12
13 trait Yay<AdditionalValue> {
14 type InnerStream<'s>: Stream<Item = i32> + 's;
15 fn foo<'s>() -> Self::InnerStream<'s>;
16 }
17
18 impl<'a> Yay<&'a ()> for () {
19 type InnerStream<'s> = impl Stream<Item = i32> + 's;
20 //^ ERROR does not fulfill the required lifetime
21 fn foo<'s>() -> Self::InnerStream<'s> {
22 ()
23 }
24 }
25
26 fn main() {}