1
Fork 0

Skip reporting item name when checking RPITIT GAT's associated type bounds hold

This commit is contained in:
Michael Goulet 2023-07-27 22:04:19 +00:00
parent 9339f446a5
commit 0ae0643a53
3 changed files with 67 additions and 6 deletions

View file

@ -0,0 +1,25 @@
// 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>> {
//~^ ERROR the type `&'a I` does not fulfill the required lifetime
(*self).iter()
}
}
fn main() {}