diff options
Diffstat (limited to 'tests/ui/generic-associated-types/issue-86218.rs')
-rw-r--r-- | tests/ui/generic-associated-types/issue-86218.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/generic-associated-types/issue-86218.rs b/tests/ui/generic-associated-types/issue-86218.rs new file mode 100644 index 000000000..b2c3071f0 --- /dev/null +++ b/tests/ui/generic-associated-types/issue-86218.rs @@ -0,0 +1,24 @@ +// check-pass + +#![feature(type_alias_impl_trait)] + +pub trait Stream { + type Item; +} + +impl Stream for () { + type Item = i32; +} + +trait Yay<AdditionalValue> { + type InnerStream<'s>: Stream<Item = i32> + 's; + fn foo<'s>() -> Self::InnerStream<'s>; +} + +impl<'a> Yay<&'a ()> for () { + type InnerStream<'s> = impl Stream<Item = i32> + 's; + //^ ERROR does not fulfill the required lifetime + fn foo<'s>() -> Self::InnerStream<'s> { () } +} + +fn main() {} |