Skip to content

Binary size regression of panic=immediate-abort since nightly-2025-09-24 #147257

@FooIbar

Description

@FooIbar

-Cpanic=immediate-abort was added in #146317 to replace -Zbuild-std-features=panic_immediate_abort.
However, we've observed a double-digit binary size regression with that:

$ cargo +nightly-2025-09-23 bloat -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort --target $(rustc --print host-tuple) --features jvm --release --crates
[...]
 File  .text     Size Crate
15.9%  23.0%  86.5KiB core
 3.2%   4.6%  17.3KiB std
[...]
$ RUSTFLAGS="-Zunstable-options -Cpanic=immediate-abort" cargo +nightly-2025-09-24 bloat -Zbuild-std=std,panic_abort --target $(rustc --print host-tuple) --features jvm --release --crates
[...]
 File  .text     Size Crate
15.9%  21.8% 116.5KiB core
11.3%  15.5%  82.6KiB std
 5.1%   7.0%  37.4KiB gimli
 1.7%   2.3%  12.5KiB addr2line
 1.5%   2.0%  10.9KiB miniz_oxide
[...]

The size of core and std is notably increased, with gimli, miniz_oxide, and addr2line starting to show up.

@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-panicArea: Panicking machineryC-bugCategory: This is a bug.I-heavyIssue: Problems and improvements with respect to binary size of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions