Change:
| Node::Item(&Item { kind: ItemKind::GlobalAsm(asm), .. }) if asm.operands.iter().any(|(op, _op_sp)| match op { hir::InlineAsmOperand::Const { anon_const } <del> | hir::InlineAsmOperand::SymFn { anon_const } => anon_const.hir_id == hir_id, </del> <ins> | hir::InlineAsmOperand::SymFn { anon_const } => { anon_const.hir_id == hir_id } </ins> _ => false, }) => { tcx.typeck(def_id).node_type(hir_id) } <del> Node::Variant(Variant { disr_expr: Some(ref e), .. }) if e.hir_id == hir_id => tcx .adt_def(tcx.hir().get_parent_item(hir_id)) .repr() .discr_type() .to_ty(tcx), </del> <ins> Node::Variant(Variant { disr_expr: Some(ref e), .. }) if e.hir_id == hir_id => { tcx.adt_def(tcx.hir().get_parent_item(hir_id)).repr().discr_type().to_ty(tcx) } </ins> <del> Node::TypeBinding(binding @ &TypeBinding { hir_id: binding_id, ..  }) if let Node::TraitRef(trait_ref) = tcx.hir().get( tcx.hir().get_parent_node(binding_id) ) => </del> <ins> Node::TypeBinding( binding @ &TypeBinding { hir_id: binding_id, kind: TypeBindingKind::Equality { term: Term::Const(ref e) }, .. }, ) if let Node::TraitRef(trait_ref) = tcx.hir().get(tcx.hir().get_parent_node(binding_id)) && e.hir_id == hir_id => </ins> { <del> let Some(trait_def_id) = trait_ref.trait_def_id() else { return tcx.ty_error_with_message(DUMMY_SP, "Could not find trait"); }; let assoc_items = tcx.associated_items(trait_def_id); let assoc_item = assoc_items.find_by_name_and_kind( tcx, binding.ident, ty::AssocKind::Const, def_id.to_def_id(), ); if let Some(assoc_item) = assoc_item { tcx.type_of(assoc_item.def_id) } else { // FIXME(associated_const_equality): add a useful error message here. tcx.ty_error_with_message( DUMMY_SP, "Could not find associated const on trait", ) } </del> <ins> let Some(trait_def_id) = trait_ref.trait_def_id() else { return tcx.ty_error_with_message(DUMMY_SP, "Could not find trait"); }; let assoc_items = tcx.associated_items(trait_def_id); let assoc_item = assoc_items.find_by_name_and_kind( tcx, binding.ident, ty::AssocKind::Const, def_id.to_def_id(), ); if let Some(assoc_item) = assoc_item { tcx.type_of(assoc_item.def_id) } else { // FIXME(associated_const_equality): add a useful error message here. tcx.ty_error_with_message( DUMMY_SP, "Could not find associated const on trait", ) } } Node::TypeBinding( binding @ &TypeBinding { hir_id: binding_id, gen_args, ref kind, .. }, ) if let Node::TraitRef(trait_ref) = tcx.hir().get(tcx.hir().get_parent_node(binding_id)) && let Some((idx, _)) = gen_args.args.iter().enumerate().find(|(_, arg)| { if let GenericArg::Const(ct) = arg { ct.value.hir_id == hir_id } else { false } }) => { let Some(trait_def_id) = trait_ref.trait_def_id() else { return tcx.ty_error_with_message(DUMMY_SP, "Could not find trait"); }; let assoc_items = tcx.associated_items(trait_def_id); let assoc_item = assoc_items.find_by_name_and_kind( tcx, binding.ident, match kind { // I think `<A: T>` type bindings requires that `A` is a type TypeBindingKind::Constraint { .. } | TypeBindingKind::Equality { term: Term::Ty(..) } => { ty::AssocKind::Type } TypeBindingKind::Equality { term: Term::Const(..) } => { ty::AssocKind::Const } }, def_id.to_def_id(), ); if let Some(assoc_item) = assoc_item { tcx.type_of(tcx.generics_of(assoc_item.def_id).params[idx].def_id) } else { // FIXME(associated_const_equality): add a useful error message here. tcx.ty_error_with_message( DUMMY_SP, "Could not find associated const on trait", ) } </ins> } Node::GenericParam(&GenericParam {

Discussion:
The following code produces several ICEs on both beta and nightly (no necessary). <!-- 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. --: <details<summary<strongBacktrace</strong</summary<p</p</details label F-genericassociatedtypes A-const-generics
This regressed in the last day...
Wait wrong issue
As GATs are stable on beta but not on stable, similar to : label regression-from-stable-to-beta
WG-prioritization assigning priority (). label -I-prioritize +P-medium