-
Notifications
You must be signed in to change notification settings - Fork 74
Unstably add -Cpanic=immediate-abort #909
Copy link
Copy link
Closed
Labels
T-compilerAdd this label so rfcbot knows to poll the compiler teamAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustcA proposal to make a major change to rustcmajor-change-acceptedA major change proposal that was acceptedA major change proposal that was accepted
Metadata
Metadata
Assignees
Labels
T-compilerAdd this label so rfcbot knows to poll the compiler teamAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustcA proposal to make a major change to rustcmajor-change-acceptedA major change proposal that was acceptedA major change proposal that was accepted
Type
Fields
Give feedbackNo fields configured for issues without a type.
Draft implementation: rust-lang/rust#146317
Proposal
We currently have a standard library feature called
panic_immediate_abort. The goal of this feature is to minimize code size, and it does so by replacing the entire panic runtime withintrinsics::abort(). For example, on x86 this aborts with just theud2instruction, not a call tolibc::abort(). In addition, panic hooks are not called which means that panic messages and backtraces are not printed. Finally, the feature adjusts some inlining attributes on panic wrappers in the standard library so that they completely optimize away.-Zbuild-std-features=panic_immediate_abortis really a new panic strategy, kludged in as a standard library feature. I'm proposing that we elevate it to an actual panic option, so that it integrates better with the toolchain. This will let users set the option in the normal way that panics are customized, and let us customize diagnostics about it.It also opens up opportunities to teach codegen about the panic mode, instead of managing an ever-growing amount of
cfg_attr(in the standard library source.And if eventually libraries want to customize their behavior to facilitate the code size optimizations that the option opens up, they could use
cfg(panic = "immediate_abort")like the standard library.Mentors or Reviewers
None
Process
The main points of the Major Change Process are as follows:
@rustbot secondor kickoff a team FCP with@rfcbot fcp $RESOLUTION.You can read more about Major Change Proposals on forge.