Ensure nested allocations in statics do not get deduplicated
This commit is contained in:
parent
92414ab25d
commit
d3514a036d
21 changed files with 259 additions and 54 deletions
|
@ -380,8 +380,12 @@ fn collect_items_rec<'tcx>(
|
|||
// Sanity check whether this ended up being collected accidentally
|
||||
debug_assert!(should_codegen_locally(tcx, &instance));
|
||||
|
||||
let ty = instance.ty(tcx, ty::ParamEnv::reveal_all());
|
||||
visit_drop_use(tcx, ty, true, starting_item.span, &mut used_items);
|
||||
let DefKind::Static { nested, .. } = tcx.def_kind(def_id) else { bug!() };
|
||||
// Nested statics have no type.
|
||||
if !nested {
|
||||
let ty = instance.ty(tcx, ty::ParamEnv::reveal_all());
|
||||
visit_drop_use(tcx, ty, true, starting_item.span, &mut used_items);
|
||||
}
|
||||
|
||||
recursion_depth_reset = None;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue