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. --%5D%0D%0Apub%20trait%20IceIce%3CT%3E%0D%0Awhere%0D%0A%20%20%20%20for%3C'a%3E%20T%3A%20'a%2C%0D%0A%7B%0D%0A%20%20%20%20type%20Ice%3C'v%3E%3A%20IntoIterator%3CItem%20%3D%20%26'v%20T%3E%3B%0D%0A%7D%0D%0A%0D%0Afn%20main()%20%7B%7D%0D%0A) <!-- 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. --The ICE happens on , and : : <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
Maybe related to
Bisection: bash cargo bisect-rustc --regress ice --test-dir=foo `
Looks like
ICE happens on stable and also even without the line so no requires-nightly. label regression-from-stable-to-stable, A-traits
Assigning priority as discussed in the of the Prioritization Working Group. label -I-prioritize +P-low

Discussion:
use rustc_hir::intravisit::Visitor; use rustc_hir::lang_items::LangItem; use rustc_hir::{ <del> Constness, HirId, ItemKind, ItemLocalId, ItemLocalMap, ItemLocalSet, Node, TraitCandidate, </del> <ins> Constness, ExprKind, HirId, ImplItemKind, ItemKind, ItemLocalId, ItemLocalMap, ItemLocalSet, Node, TraitCandidate, TraitItemKind, </ins> }; use rustc_index::vec::{Idx, IndexVec}; use rustc_macros::HashStable;

} pub fn return_type_impl_trait(self, scope_def_id: LocalDefId) -> Option<(Ty<'tcx>, Span)> { <del> // HACK: `type_of_def_id()` will fail on these (#55796), so return `None`. </del> <ins> // `type_of()` will fail on these (#55796, #86483), so only allow `fn`s or closures. </ins> let hir_id = self.hir().local_def_id_to_hir_id(scope_def_id); match self.hir().get(hir_id) { <del> Node::Item(item) => { match item.kind { ItemKind::Fn(..) => { /* `type_of_def_id()` will work */ } _ => { return None; } } } _ => { /* `type_of_def_id()` will work or panic */ } </del> <ins> Node::Item(&hir::Item { kind: ItemKind::Fn(..), .. }) => {} Node::TraitItem(&hir::TraitItem { kind: TraitItemKind::Fn(..), .. }) => {} Node::ImplItem(&hir::ImplItem { kind: ImplItemKind::Fn(..), .. }) => {} Node::Expr(&hir::Expr { kind: ExprKind::Closure(..), .. }) => {} _ => return None, </ins> } let ret_ty = self.type_of(scope_def_id);

x => tcx.ty_error_with_message( DUMMY_SP, <del> &format!("unexpected const parent in type_of_def_id(): {:?}", x), </del> <ins> &format!("unexpected const parent in type_of(): {:?}", x), </ins> ), } }

}, x => { <del> bug!("unexpected sort of node in type_of_def_id(): {:?}", x); </del> <ins> bug!("unexpected sort of node in type_of(): {:?}", x); </ins> } } }

<ins> // Regression test of #86483. #![feature(generic_associated_types)] #![allow(incomplete_features)] pub trait IceIce<T> //~ ERROR: the parameter type `T` may not live long enough where for<'a> T: 'a, { type Ice<'v>: IntoIterator<Item = &'v T>; //~^ ERROR: the parameter type `T` may not live long enough //~| ERROR: the parameter type `T` may not live long enough } fn main() {} </ins>

<ins> error[E0311]: the parameter type `T` may not live long enough --> $DIR/issue-86483.rs:6:1 | LL |   pub trait IceIce<T> |   ^                - help: consider adding an explicit lifetime bound...: `T: 'a` |  _| | | LL | | where LL | |     for<'a> T: 'a, LL | | { ...  | LL | | LL | | } | |_^ ...so that the type `T` will meet its required lifetime bounds error[E0311]: the parameter type `T` may not live long enough --> $DIR/issue-86483.rs:10:5 | LL | pub trait IceIce<T> |                  - help: consider adding an explicit lifetime bound...: `T: 'a` ... LL |     type Ice<'v>: IntoIterator<Item = &'v T>; |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds error[E0309]: the parameter type `T` may not live long enough --> $DIR/issue-86483.rs:10:32 | LL | pub trait IceIce<T> |                  - help: consider adding an explicit lifetime bound...: `T: 'v` ... LL |     type Ice<'v>: IntoIterator<Item = &'v T>; |                                ^^^^^^^^^^^^ ...so that the reference type `&'v T` does not outlive the data it points at error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0309`. </ins>