Skip to content

Allow asserts and panics to abort process quietly. #54981

Closed
@vi

Description

@vi

Currently assertions cause executable to be bloated up by various formatting-related symbols like

 0.5%   2.8%   1020B       std <core::fmt::builders::PadAdapter<'_> as core::fmt::Write>::write_str
 0.4%   2.3%    860B       std core::char::methods::<impl char>::escape_debug
 0.4%   2.2%    804B       std core::fmt::Formatter::pad_integral

, causing executables that carefully choose functions to call in order to stay under X kilobytes to suddenly grow by about 40-150 kilobytes. Additionally, pthread_* symbols appear in otherwise single-threaded module. Symbol count may jump by about 800.

Shall there be some mode (like panic = "really-abort") or a libstd feature settable in Xargo.toml that makes all panics just do plain raw abort without trying to collect backtrace or print anything at all?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions