diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs new file mode 100644 index 000000000..ff7ad4bf3 --- /dev/null +++ b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs @@ -0,0 +1,24 @@ +// issue: 114145 + +#![feature(return_position_impl_trait_in_trait)] + +trait Iterable { + type Item<'a> + where + Self: 'a; + + fn iter(&self) -> impl '_ + Iterator<Item = Self::Item<'_>>; +} + +impl<'a, I: 'a + Iterable> Iterable for &'a I { + type Item<'b> = I::Item<'a> + where + 'b: 'a; + //~^ ERROR impl has stricter requirements than trait + + fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> { + (*self).iter() + } +} + +fn main() {} |