Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
This needs detailed investigation, and I'd prefer we fully understand why this is resulting in a region error over just adding an check to (or feeding the query).... This probably has to do with the fact that we have a due to the missing region .

Discussion:
} infer::CheckAssociatedTypeBounds { impl_item_def_id, trait_item_def_id, parent } => { let mut err = self.report_concrete_failure(*parent, sub, sup); <del> let trait_item_span = self.tcx.def_span(trait_item_def_id); let item_name = self.tcx.item_name(impl_item_def_id.to_def_id()); err.span_label( trait_item_span, format!("definition of `{}` from trait", item_name), ); </del> <ins> // Don't mention the item name if it's an RPITIT, since that'll just confuse // folks. if !self.tcx.is_impl_trait_in_trait(impl_item_def_id.to_def_id()) { let trait_item_span = self.tcx.def_span(trait_item_def_id); let item_name = self.tcx.item_name(impl_item_def_id.to_def_id()); err.span_label( trait_item_span, format!("definition of `{}` from trait", item_name), ); } </ins> self.suggest_copy_trait_method_bounds( trait_item_def_id, impl_item_def_id,

) -> LocalDefId { let impl_local_def_id = tcx.local_parent(impl_fn_def_id); <del> // FIXME fix the span, we probably want the def_id of the return type of the function let span = tcx.def_span(impl_fn_def_id); </del> <ins> let decl = tcx .hir() .find_by_def_id(impl_fn_def_id) .expect("expected item") .fn_decl() .expect("expected decl"); let span = match decl.output { hir::FnRetTy::DefaultReturn(_) => tcx.def_span(impl_fn_def_id), hir::FnRetTy::Return(ty) => ty.span, }; </ins> let impl_assoc_ty = tcx.at(span).create_def(impl_local_def_id, DefPathData::ImplTraitAssocTy); let local_def_id = impl_assoc_ty.def_id();

<ins> // issue: 114146 #![feature(return_position_impl_trait_in_trait)] trait Foo { fn bar<'other: 'a>() -> impl Sized + 'a {} //~^ ERROR use of undeclared lifetime name `'a` //~| ERROR use of undeclared lifetime name `'a` } fn main() {} </ins>

<ins> error[E0261]: use of undeclared lifetime name `'a` --> $DIR/bad-item-bound-within-rpitit-2.rs:6:20 | LL |     fn bar<'other: 'a>() -> impl Sized + 'a {} |                    ^^ undeclared lifetime | help: consider introducing lifetime `'a` here | LL |     fn bar<'a, 'other: 'a>() -> impl Sized + 'a {} |            +++ help: consider introducing lifetime `'a` here | LL | trait Foo<'a> { |          ++++ error[E0261]: use of undeclared lifetime name `'a` --> $DIR/bad-item-bound-within-rpitit-2.rs:6:42 | LL |     fn bar<'other: 'a>() -> impl Sized + 'a {} |                                          ^^ undeclared lifetime | help: consider introducing lifetime `'a` here | LL |     fn bar<'a, 'other: 'a>() -> impl Sized + 'a {} |            +++ help: consider introducing lifetime `'a` here | LL | trait Foo<'a> { |          ++++ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0261`. </ins>

<ins> // 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() {} </ins>

<ins> error[E0276]: impl has stricter requirements than trait --> $DIR/bad-item-bound-within-rpitit.rs:16:13 | LL |     type Item<'a> |     ------------- definition of `Item` from trait ... LL |         'b: 'a; |             ^^ impl has extra requirement `'b: 'a` | help: copy the `where` clause predicates from the trait | LL |     where Self: 'b; |     ~~~~~~~~~~~~~~ error[E0477]: the type `&'a I` does not fulfill the required lifetime --> $DIR/bad-item-bound-within-rpitit.rs:19:23 | LL |     fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> { |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: type must outlive the anonymous lifetime as defined here --> $DIR/bad-item-bound-within-rpitit.rs:10:28 | LL |     fn iter(&self) -> impl '_ + Iterator<Item = Self::Item<'_>>; |                            ^^ error: aborting due to 2 previous errors Some errors have detailed explanations: E0276, E0477. For more information about an error, try `rustc --explain E0276`. </ins>