]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/issue-86218.rs
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / tests / ui / generic-associated-types / issue-86218.rs
1 // check-pass
2
3 #![feature(type_alias_impl_trait)]
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 fn main() {}