Skip reporting item name when checking RPITIT GAT's associated type bounds hold
This commit is contained in:
parent
9339f446a5
commit
0ae0643a53
3 changed files with 67 additions and 6 deletions
25
tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs
Normal file
25
tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs
Normal 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() {}
|
Loading…
Add table
Add a link
Reference in a new issue