Auto merge of #135465 - jhpratt:rollup-7p93bct, r=jhpratt
Rollup of 10 pull requests Successful merges: - #134498 (Fix cycle error only occurring with -Zdump-mir) - #134977 (Detect `mut arg: &Ty` meant to be `arg: &mut Ty` and provide structured suggestion) - #135390 (Re-added regression test for #122638) - #135393 (uefi: helpers: Introduce OwnedDevicePath) - #135440 (rm unnecessary `OpaqueTypeDecl` wrapper) - #135441 (Make sure to mark `IMPL_TRAIT_REDUNDANT_CAPTURES` as `Allow` in edition 2024) - #135444 (Update books) - #135450 (Fix emscripten-wasm-eh with unwind=abort) - #135452 (bootstrap: fix outdated feature name in comment) - #135454 (llvm: Allow sized-word rather than ymmword in tests) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
35c2908177
34 changed files with 492 additions and 83 deletions
|
@ -1555,16 +1555,22 @@ pub fn write_allocations<'tcx>(
|
|||
write!(w, " (vtable: impl {dyn_ty} for {ty})")?
|
||||
}
|
||||
Some(GlobalAlloc::Static(did)) if !tcx.is_foreign_item(did) => {
|
||||
match tcx.eval_static_initializer(did) {
|
||||
Ok(alloc) => {
|
||||
write!(w, " (static: {}, ", tcx.def_path_str(did))?;
|
||||
write_allocation_track_relocs(w, alloc)?;
|
||||
write!(w, " (static: {}", tcx.def_path_str(did))?;
|
||||
if body.phase <= MirPhase::Runtime(RuntimePhase::PostCleanup)
|
||||
&& tcx.hir().body_const_context(body.source.def_id()).is_some()
|
||||
{
|
||||
// Statics may be cyclic and evaluating them too early
|
||||
// in the MIR pipeline may cause cycle errors even though
|
||||
// normal compilation is fine.
|
||||
write!(w, ")")?;
|
||||
} else {
|
||||
match tcx.eval_static_initializer(did) {
|
||||
Ok(alloc) => {
|
||||
write!(w, ", ")?;
|
||||
write_allocation_track_relocs(w, alloc)?;
|
||||
}
|
||||
Err(_) => write!(w, ", error during initializer evaluation)")?,
|
||||
}
|
||||
Err(_) => write!(
|
||||
w,
|
||||
" (static: {}, error during initializer evaluation)",
|
||||
tcx.def_path_str(did)
|
||||
)?,
|
||||
}
|
||||
}
|
||||
Some(GlobalAlloc::Static(did)) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue