Change:
<ins> error[E0261]: use of undeclared lifetime name `'a` --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:68 | LL |     reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } |                                                                    ^^ undeclared lifetime | help: consider introducing lifetime `'a` here | LL |     reuse <u8 as Trait>::{foo'a, , bar, meh} { &const { InvariantRef::<'a>::NEW } } |                              +++ help: consider introducing lifetime `'a` here | LL | impl<'a> Trait for Z { |     ++++ error[E0261]: use of undeclared lifetime name `'a` --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:68 | LL |     reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } |                                                                    ^^ undeclared lifetime | help: consider introducing lifetime `'a` here | LL |     reuse <u8 as Trait>::{foo, bar'a, , meh} { &const { InvariantRef::<'a>::NEW } } |                                   +++ help: consider introducing lifetime `'a` here | LL | impl<'a> Trait for Z { |     ++++ error[E0261]: use of undeclared lifetime name `'a` --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:68 | LL |     reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } |                                                                    ^^ undeclared lifetime | help: consider introducing lifetime `'a` here | LL |     reuse <u8 as Trait>::{foo, bar, meh'a, } { &const { InvariantRef::<'a>::NEW } } |                                        +++ help: consider introducing lifetime `'a` here | LL | impl<'a> Trait for Z { |     ++++ error[E0599]: no function or associated item named `new` found for struct `InvariantRef` in the current scope --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:9:41 | LL | pub struct InvariantRef<'a, T: ?Sized>(&'a T, PhantomData<&'a mut &'a T>); | -------------------------------------- function or associated item `new` not found for this struct ... LL |     pub const NEW: Self = InvariantRef::new(&()); |                                         ^^^ function or associated item not found in `InvariantRef<'_, _>` error[E0308]: mismatched types --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:53 | LL |     reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } |                                                     ^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `InvariantRef<'_, ()>` | = note: expected type `u8` found struct `InvariantRef<'_, ()>` error[E0277]: the trait bound `u8: Trait` is not satisfied --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:12 | LL |     reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } |            ^^ the trait `Trait` is not implemented for `u8` | = help: the trait `Trait` is implemented for `Z` error[E0308]: mismatched types --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:53 | LL |     reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } |                                                     ^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `InvariantRef<'_, ()>` | = note: expected type `u8` found struct `InvariantRef<'_, ()>` = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0277]: the trait bound `u8: Trait` is not satisfied --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:12 | LL |     reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } |            ^^ the trait `Trait` is not implemented for `u8` | = help: the trait `Trait` is implemented for `Z` = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0308]: mismatched types --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:53 | LL |     reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } |                                                     ^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `InvariantRef<'_, ()>` | = note: expected type `u8` found struct `InvariantRef<'_, ()>` = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0277]: the trait bound `u8: Trait` is not satisfied --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:12 | LL |     reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } |            ^^ the trait `Trait` is not implemented for `u8` | = help: the trait `Trait` is implemented for `Z` = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: aborting due to 10 previous errors Some errors have detailed explanations: E0261, E0277, E0308, E0599. For more information about an error, try `rustc --explain E0261`. </ins>

Discussion:
<!-- [31mICE[0m: Rustc '' 'thread 'rustc' panicked at 'called on a value'', 'thread 'rustc' panicked at 'called on a value'' File: --auto-reduced (treereduce-rust): &lt;details&lt;summary&lt;strongoriginal code&lt;/strong&lt;/summary&lt;poriginal: </p</detailsVersion information ` Command: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongProgram output</strong</summary<p</p</details<!-- query stack: [typeck] type-checking [checkmatch] match-checking -- label +F-constgenerics +F-constevaluatablechecked
Slightly minimized with fewer errors: The compiler seems to have trouble figuring out whether the type of matches the returned type <details<summaryProgram output</summary</summary

<!-- 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<strongICE location label +F-fn_delegation
Adding more methods in trait creates more ICE :eyes: <details<summary<strongBacktrace</strong</summary<p</p</details