Auto merge of #90050 - michaelwoerister:fix-vtable-debug-name-crash-90019, r=wesleywiser
Erase late-bound regions before computing vtable debuginfo name. Fixes #90019. The `msvc_enum_fallback()` for computing enum type names needs to access the memory layout of niche enums in order to determine the type name. `compute_debuginfo_vtable_name()` did not properly erase regions before computing type names which made memory layout computation ICE when encountering un-erased regions. r? `@wesleywiser`
This commit is contained in:
commit
3d71e749a2
2 changed files with 14 additions and 7 deletions
|
@ -480,14 +480,11 @@ pub fn compute_debuginfo_vtable_name<'tcx>(
|
|||
}
|
||||
|
||||
if let Some(trait_ref) = trait_ref {
|
||||
push_item_name(tcx, trait_ref.skip_binder().def_id, true, &mut vtable_name);
|
||||
let trait_ref =
|
||||
tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), trait_ref);
|
||||
push_item_name(tcx, trait_ref.def_id, true, &mut vtable_name);
|
||||
visited.clear();
|
||||
push_generic_params_internal(
|
||||
tcx,
|
||||
trait_ref.skip_binder().substs,
|
||||
&mut vtable_name,
|
||||
&mut visited,
|
||||
);
|
||||
push_generic_params_internal(tcx, trait_ref.substs, &mut vtable_name, &mut visited);
|
||||
} else {
|
||||
vtable_name.push_str("_");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue