Uh oh!
There was an error while loading. Please reload this page.
abort in core - #154604
Conversation
rustbot
commented
Mar 30, 2026
rustbot
commented
Mar 30, 2026
r? @scottmcm rustbot has assigned @scottmcm. Use Why was this reviewer chosen?The reviewer was selected based on:
|
CAD97
commented
Mar 30, 2026
|
RalfJung
commented
Mar 30, 2026
Cc @bjorn3 who knows a lot about the alloc shims. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
bjorn3
commented
Mar 30, 2026
Imagine the following scenario:
When building liba, we need to already generate the Also cc @anforowicz for Chromium which bypasses the allocator shim. I think it will be fine for you as you include libstd, but I'm not sure if you don't have any no_std executables. It is probably more of an issue for Bazel. |
anforowicz
commented
Mar 30, 2026
Thank you for the heads-up.
/cc @DKLoehr from the Chromium Toolchain team as FYI |
CAD97
commented
Mar 30, 2026
Given core |
CAD97
commented
Mar 30, 2026
I decided to rebase this branch/PR to just include |
This comment has been minimized.
This comment has been minimized.
| /// # Platform-specific behavior | ||
| /// | ||
| /// `abort_immediate` lowers to a trap instruction on *most* architectures; on | ||
| /// some architectures it simply lowers to call the unmangled `abort` function. |
There was a problem hiding this comment.
I adapted this wording from the panic-abort crate docs.
extern "C" { #[no_mangle] fn abort() -> !; } will be libc::abort in most cases, yes, but I'm not personally aware of what platforms have what behavior here.
There was a problem hiding this comment.
gotcha. cc @japaric, this PR is heavily based on your panic-abort crate.
There was a problem hiding this comment.
I don't think "unmangled abort" is very clear. Maybe refer to is as "the C abort function" or so.
There was a problem hiding this comment.
Also, on which targets does this call libc::abort?
scottmcm
commented
Apr 16, 2026
Sure, as just an unstable library API this seems fine @bors r+ rollup |
abort in core Implements `core::process::abort_immediate` as a wrapper around `intrinsics::abort`. - tracking issue: rust-lang#154601 (This PR used to also add `core::process::abort`, but that's been deferred to a later addition.)
Rollup of 18 pull requests Successful merges: - #154595 (Emit fatal on invalid const args with nested defs) - #154599 (report the `varargs_without_pattern` lint in deps) - #154699 (`core::unicode`: Replace `Cased` table with `Lt`) - #155353 (resolve: Remove `inaccessible_ctor_reexport` resolver field) - #155357 (Add `--remap-path-scope` as unstable in rustdoc) - #150649 (clippy fix: non_canonical_clone_impl) - #154604 (abort in core) - #154616 (Add `--quiet` flag to x.py and bootstrap to suppress output) - #154970 (rustdoc: preserve `doc(cfg)` on locally re-exported type aliases) - #155215 (Clean up `AttributeLintKind` and refactor diagnostic attribute linting) - #155228 (Check diagnostic output in incremental `cpass` and `rpass` revisions) - #155266 (Adjust release notes for post-merge feedback) - #155326 (Disallow ZST allocations with `TypedArena`.) - #155334 (docs: Use `0b1` instead of `NonZero::MIN` in `NonZero::bit_width` doctests) - #155340 (Handle nonnull pattern types in size skeleton) - #155347 (Add push_mut and new Layout methods to release notes) - #155356 (remove calls to AliasTyKind::def_id) - #155364 (Reduce diagnostic type visibilities.)
There's an unresolved comment further up. It's not blocking but @CAD97 please make sure to take care of it post-landing. |
Rollup of 18 pull requests Successful merges: - #154451 (Require that a `<_ as Try>::Residual` implement the `Residual` trait) - #154595 (Emit fatal on invalid const args with nested defs) - #154599 (report the `varargs_without_pattern` lint in deps) - #154699 (`core::unicode`: Replace `Cased` table with `Lt`) - #155353 (resolve: Remove `inaccessible_ctor_reexport` resolver field) - #155357 (Add `--remap-path-scope` as unstable in rustdoc) - #150649 (clippy fix: non_canonical_clone_impl) - #154604 (abort in core) - #154616 (Add `--quiet` flag to x.py and bootstrap to suppress output) - #155215 (Clean up `AttributeLintKind` and refactor diagnostic attribute linting) - #155228 (Check diagnostic output in incremental `cpass` and `rpass` revisions) - #155266 (Adjust release notes for post-merge feedback) - #155326 (Disallow ZST allocations with `TypedArena`.) - #155334 (docs: Use `0b1` instead of `NonZero::MIN` in `NonZero::bit_width` doctests) - #155340 (Handle nonnull pattern types in size skeleton) - #155347 (Add push_mut and new Layout methods to release notes) - #155356 (remove calls to AliasTyKind::def_id) - #155364 (Reduce diagnostic type visibilities.)
Uh oh!
There was an error while loading. Please reload this page.
Rollup of 18 pull requests Successful merges: - rust-lang/rust#154451 (Require that a `<_ as Try>::Residual` implement the `Residual` trait) - rust-lang/rust#154595 (Emit fatal on invalid const args with nested defs) - rust-lang/rust#154599 (report the `varargs_without_pattern` lint in deps) - rust-lang/rust#154699 (`core::unicode`: Replace `Cased` table with `Lt`) - rust-lang/rust#155353 (resolve: Remove `inaccessible_ctor_reexport` resolver field) - rust-lang/rust#155357 (Add `--remap-path-scope` as unstable in rustdoc) - rust-lang/rust#150649 (clippy fix: non_canonical_clone_impl) - rust-lang/rust#154604 (abort in core) - rust-lang/rust#154616 (Add `--quiet` flag to x.py and bootstrap to suppress output) - rust-lang/rust#155215 (Clean up `AttributeLintKind` and refactor diagnostic attribute linting) - rust-lang/rust#155228 (Check diagnostic output in incremental `cpass` and `rpass` revisions) - rust-lang/rust#155266 (Adjust release notes for post-merge feedback) - rust-lang/rust#155326 (Disallow ZST allocations with `TypedArena`.) - rust-lang/rust#155334 (docs: Use `0b1` instead of `NonZero::MIN` in `NonZero::bit_width` doctests) - rust-lang/rust#155340 (Handle nonnull pattern types in size skeleton) - rust-lang/rust#155347 (Add push_mut and new Layout methods to release notes) - rust-lang/rust#155356 (remove calls to AliasTyKind::def_id) - rust-lang/rust#155364 (Reduce diagnostic type visibilities.)
Rollup of 18 pull requests Successful merges: - rust-lang/rust#154451 (Require that a `<_ as Try>::Residual` implement the `Residual` trait) - rust-lang/rust#154595 (Emit fatal on invalid const args with nested defs) - rust-lang/rust#154599 (report the `varargs_without_pattern` lint in deps) - rust-lang/rust#154699 (`core::unicode`: Replace `Cased` table with `Lt`) - rust-lang/rust#155353 (resolve: Remove `inaccessible_ctor_reexport` resolver field) - rust-lang/rust#155357 (Add `--remap-path-scope` as unstable in rustdoc) - rust-lang/rust#150649 (clippy fix: non_canonical_clone_impl) - rust-lang/rust#154604 (abort in core) - rust-lang/rust#154616 (Add `--quiet` flag to x.py and bootstrap to suppress output) - rust-lang/rust#155215 (Clean up `AttributeLintKind` and refactor diagnostic attribute linting) - rust-lang/rust#155228 (Check diagnostic output in incremental `cpass` and `rpass` revisions) - rust-lang/rust#155266 (Adjust release notes for post-merge feedback) - rust-lang/rust#155326 (Disallow ZST allocations with `TypedArena`.) - rust-lang/rust#155334 (docs: Use `0b1` instead of `NonZero::MIN` in `NonZero::bit_width` doctests) - rust-lang/rust#155340 (Handle nonnull pattern types in size skeleton) - rust-lang/rust#155347 (Add push_mut and new Layout methods to release notes) - rust-lang/rust#155356 (remove calls to AliasTyKind::def_id) - rust-lang/rust#155364 (Reduce diagnostic type visibilities.)
View all comments
Implements
core::process::abort_immediateas a wrapper aroundintrinsics::abort.(This PR used to also add
core::process::abort, but that's been deferred to a later addition.)