Skip to content

intrinsics: Rename abort to abort_immediate - #163574

Open
tgross35 wants to merge 1 commit into
rust-lang:mainfrom
tgross35:intrinsics-abort-rename
Open

tgross35 wants to merge 1 commit into
rust-lang:mainfrom
tgross35:intrinsics-abort-rename

Conversation

@tgross35

@tgross35 tgross35 commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

The semantics of intrinsics::abort() are closer to what we have unstably as abort_immediate() than to process::abort() or libc::abort(). Rename it to make more clear that the intrinsic is more of an intentional crash with platform-specific behavior than what libc::abort() tries to be (i.e. raising SIGABRT).

If desired, a new intrinsic like abort_gracefully could be introduced that performs platform-specific behavior. This would more cleanly unblock #149780.

See also discussion at the tracking issue for immediate_abort #154601.

r? @RalfJung I suppose

@rustbot

rustbot commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

stdarch is developed in its own repository. If possible, consider making this change to rust-lang/stdarch instead.

cc @Amanieu, @folkertdev, @sayantn

rustfmt is developed in its own repository. If possible, consider making this change to rust-lang/rustfmt instead.

cc @rust-lang/rustfmt

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

rustc_codegen_gcc is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_gcc instead.

cc @antoyo, @GuillaumeGomez

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

rustc_codegen_cranelift is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_cranelift instead.

cc @bjorn3

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-unix Operating system: Unix-like O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Sep 30, 2026
@rustbot

rustbot commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

RalfJung is not on the review rotation at the moment.
They may take a while to respond.

@rust-log-analyzer

This comment has been minimized.

Comment thread src/tools/rustfmt/tests/source/match.rs Outdated
Comment thread src/tools/rustfmt/tests/source/match.rs Outdated
Comment thread src/tools/rustfmt/tests/source/match.rs Outdated
ytmimi
ytmimi previously requested changes Oct 1, 2026

@ytmimi ytmimi left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert whitespace changes in rustfmt source test files.

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 1, 2026
@tgross35
tgross35 force-pushed the intrinsics-abort-rename branch from f9baace to bdc9dac Compare October 1, 2026 02:50
@rust-log-analyzer

This comment has been minimized.

@ytmimi ytmimi left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rustfmt changes look good now. Thanks for reverting the whitespace changes.

View changes since this review

@ytmimi
ytmimi dismissed their stale review October 1, 2026 03:48

whitespace changes were removed.

@tgross35

tgross35 commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Ah yeah sorry! Trim on save got me of course.

@tgross35
tgross35 force-pushed the intrinsics-abort-rename branch from bdc9dac to bfade6d Compare October 1, 2026 04:05
@rust-log-analyzer

This comment has been minimized.

The semantics of `intrinsics::abort()` are closer to what we have
unstably as `abort_immediate()` than to `process::abort()` or
`libc::abort()`. Rename it to make more clear that the intrinsic is more
of an intentional crash with platform-specific behavior than what
`libc::abort()` tries to be (i.e. raising `SIGABRT`).
@tgross35
tgross35 force-pushed the intrinsics-abort-rename branch from bfade6d to 4a133bf Compare October 1, 2026 05:22
@RalfJung

RalfJung commented Oct 1, 2026

Copy link
Copy Markdown
Member

I agree with the change but don't have time to review it, sorry.
@rustbot reroll

@tgross35

tgross35 commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 1, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor

@bors r+ rollup

Strong agree that we should try to rename intrinsics to match their stable counterparts. It just is a lot of effort that many folks don't want to put in. Thanks for doing this.

@rust-bors

rust-bors Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4a133bf has been approved by clarfonthey

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 1, 2026
@tgross35

tgross35 commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Thank you! This will race a bit with #163621 so I'm going to let that go first, think this one may be slightly more failure-prone.

@bors r-

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 1, 2026
@rust-bors

rust-bors Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

View changes since this unapproval

@rust-bors

rust-bors Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #163630) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-unix Operating system: Unix-like O-windows Operating system: Windows S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants