Change:
<!-- Thank you for filing a bug report! Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. --I tried this code I expected to see this happen: A slightly better error message Instead, this happened: A slightly confusing error message <!-- 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<summaryBacktrace</summary<p</p</details

Discussion:
} } } <del> if let RegionResolutionError::ConcreteFailure(origin, _, _) = error.clone() { </del> <ins> if let RegionResolutionError::ConcreteFailure(origin, _, _) | RegionResolutionError::GenericBoundFailure(origin, _, _) = error.clone() { </ins> if let SubregionOrigin::CompareImplTypeObligation { span, item_name,

impl<T> Foo for Fooy<T> { type A<'a> where Self: 'static = (&'a ()); <del> //~^ ERROR the parameter type `T` may not live long enough </del> <ins> //~^ ERROR `impl` associated type </ins> type B<'a, 'b> where 'b: 'a = (&'a(), &'b ()); //~^ ERROR `impl` associated type //~| ERROR lifetime bound not satisfied

<del> error[E0310]: the parameter type `T` may not live long enough </del> <ins> error: `impl` associated type signature for `A` doesn't match `trait` associated type signature </ins> --> $DIR/impl_bounds.rs:15:5 | <ins> LL |     type A<'a> where Self: 'a; |     -------------------------- expected ... </ins> LL |     type A<'a> where Self: 'static = (&'a ()); <del> |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider adding an explicit lifetime bound `T: 'static`... = note: ...so that the definition in impl matches the definition from the trait </del> <ins> |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found </ins> error: `impl` associated type signature for `B` doesn't match `trait` associated type signature --> $DIR/impl_bounds.rs:17:5

error: aborting due to 5 previous errors <del> Some errors have detailed explanations: E0277, E0310, E0478. </del> <ins> Some errors have detailed explanations: E0277, E0478. </ins> For more information about an error, try `rustc --explain E0277`.

{ type T = Either<Left::T, Right::T>; type TRef<'a> <del> //~^ the associated type //~^^ the associated type </del> <ins> //~^ `impl` associated type signature //~^^ `impl` associated type signature </ins> where <Left as HasChildrenOf>::T: 'a, <Right as HasChildrenOf>::T: 'a

<del> error[E0309]: the associated type `<Left as HasChildrenOf>::T` may not live long enough </del> <ins> error: `impl` associated type signature for `TRef` doesn't match `trait` associated type signature </ins> --> $DIR/issue-86787.rs:23:5 | <ins> LL |       type TRef<'a>; |       -------------- expected ... </ins> LL | /     type TRef<'a> LL | | LL | | LL | |     where LL | |     <Left as HasChildrenOf>::T: 'a, LL | |     <Right as HasChildrenOf>::T: 'a <del> | |                                    - help: consider adding a where clause: `, <Left as HasChildrenOf>::T: 'a` </del> LL | |     = Either<&'a Left::T, &'a Right::T>; <del> | |________________________________________^ ...so that the definition in impl matches the definition from the trait </del> <ins> | |________________________________________^ found </ins> <del> error[E0309]: the associated type `<Right as HasChildrenOf>::T` may not live long enough </del> <ins> error: `impl` associated type signature for `TRef` doesn't match `trait` associated type signature </ins> --> $DIR/issue-86787.rs:23:5 | <ins> LL |       type TRef<'a>; |       -------------- expected ... </ins> LL | /     type TRef<'a> LL | | LL | | LL | |     where LL | |     <Left as HasChildrenOf>::T: 'a, LL | |     <Right as HasChildrenOf>::T: 'a <del> | |                                    - help: consider adding a where clause: `, <Right as HasChildrenOf>::T: 'a` </del> LL | |     = Either<&'a Left::T, &'a Right::T>; <del> | |________________________________________^ ...so that the definition in impl matches the definition from the trait </del> <ins> | |________________________________________^ found </ins> error: aborting due to 2 previous errors <del> For more information about this error, try `rustc --explain E0309`. </del>