GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — abort in core by CAD97 · Pull Request #154604 · rust-lang/rust

Conversation

@CAD97

@CAD97 CAD97 commented Mar 30, 2026 •
edited by rustbot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

View all comments

Implements core::process::abort_immediate as a wrapper around intrinsics::abort.

  • tracking issue: Tracking Issue for abort_immediate (abort in core) #154601

(This PR used to also add core::process::abort, but that's been deferred to a later addition.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jyn514, juntyr, teor2345, and matthieu-m reacted with heart emoji
All reactions
  • ❤️ 4 reactions
@rustbot

rustbot commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rustbot rustbot added 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. labels Mar 30, 2026
@rustbot rustbot assigned scottmcm Mar 30, 2026
@rustbot

rustbot commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator

r? @scottmcm

rustbot has assigned @scottmcm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @scottmcm, libs
  • @scottmcm, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, scottmcm
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CAD97

CAD97 commented Mar 30, 2026

Copy link
Copy Markdown
Contributor Author

tests/ui/extern-flag and tests/ui/no_std caught that __rust_abort still wasn't being defined. I think this must be because std is available (and thus lang = "abort_impl" is defined, but #![no_std] means that we aren't linking std. I'm now looking for how to directly gate the shim on if std is getting linked, to avoid adding a new requirement to no_std binaries.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RalfJung

RalfJung commented Mar 30, 2026

Copy link
Copy Markdown
Member

Cc @bjorn3 who knows a lot about the alloc shims.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

RalfJung
RalfJung reviewed Mar 30, 2026
View reviewed changes
Comment thread library/core/src/process.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

RalfJung
RalfJung reviewed Mar 30, 2026
View reviewed changes
Comment thread library/core/src/process.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@rust-log-analyzer

This comment has been minimized.

Sign in to view
bjorn3
bjorn3 reviewed Mar 30, 2026
View reviewed changes
Comment thread compiler/rustc_codegen_ssa/src/base.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bjorn3

bjorn3 commented Mar 30, 2026

Copy link
Copy Markdown
Member

Imagine the following scenario:

  • liba depends on libcore and gets linked as dylib
  • libb depends on liba and libstd

When building liba, we need to already generate the __rust_abort symbol, but would conflict with the one from libstd. This is not a breaking change on most targets as due to what is arguably a bug in rustc, in this scenario rustc will report an error about libcore getting linked twice. If however you remove libstd.so or link for a target for which we don't ship libstd as dylib yet do still support dynamic linking (i don't know if any such target exists. maybe a wasm target?), then this scenario would currently work fine, but break with this PR.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@anforowicz

anforowicz commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

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.

Thank you for the heads-up.

  • I think it doesn't impact Chromium, because Chromium product builds link everything statically (no dylibs, only rlibs that are at the end linked by non-rustc-driven linker).
  • OTOH we are currently working on building std into a dylib in developer builds (and later plan to expand this to some other libraries - e.g. the log crate). But this still seems ok, because I think that Chromium doesn't have a library like liba (linked as dylib, but depends on core and not on std).
  • That said, I don't fully understand the changes in this PR, so I defer to your judgement / I don't really understand if these changes may require a follow-up in Chromium when/if they get absorbed.

/cc @DKLoehr from the Chromium Toolchain team as FYI

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CAD97

CAD97 commented Mar 30, 2026

Copy link
Copy Markdown
Contributor Author

Given core abort is essentially blocked on EIIs being ready, would it make sense to PR abort_immediate separately first?

jyn514 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CAD97
add abort_immediate
3a311ed
@CAD97
CAD97 force-pushed the abort-immediate branch from 807cd4e to 3a311ed Compare March 30, 2026 22:56
@CAD97

CAD97 commented Mar 30, 2026

Copy link
Copy Markdown
Contributor Author

I decided to rebase this branch/PR to just include abort_immediate, which is useful on its own. abort can be added later once EII can be utilized to do so properly.

bjorn3 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CAD97 CAD97 mentioned this pull request Mar 30, 2026
Tracking Issue for abort_immediate (abort in core) #154601
Open
2 of 7 tasks
@rust-log-analyzer

This comment has been minimized.

Sign in to view
@CAD97
add missing core::process module docs
fb99fbe
jyn514
jyn514 reviewed Mar 30, 2026
View reviewed changes
Comment thread library/core/src/process.rs
/// # 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.

@jyn514 jyn514 Mar 30, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

"unmangled" you mean libc::abort?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@CAD97 CAD97 Mar 31, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jyn514 jyn514 Mar 31, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

gotcha. cc @japaric, this PR is heavily based on your panic-abort crate.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@RalfJung RalfJung Mar 31, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't think "unmangled abort" is very clear. Maybe refer to is as "the C abort function" or so.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jyn514, Expurple, and GrigorenkoPV reacted with thumbs up emoji
All reactions
  • 👍 3 reactions

@RalfJung RalfJung Apr 16, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Also, on which targets does this call libc::abort?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@scottmcm

scottmcm commented Apr 16, 2026

Copy link
Copy Markdown
Member

Sure, as just an unstable library API this seems fine

@bors r+ rollup

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rust-bors

rust-bors Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

📌 Commit fb99fbe has been approved by scottmcm

It is now in the queue for this repository.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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 Apr 16, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 16, 2026
@jhpratt
Rollup merge of rust-lang#154604 - CAD97:abort-immediate, r=scottmcm
3034c55
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.)
@jhpratt jhpratt mentioned this pull request Apr 16, 2026
Rollup of 18 pull requests #155373
Closed
rust-bors Bot pushed a commit that referenced this pull request Apr 16, 2026
@bors
Auto merge of #155373 - jhpratt:rollup-qjxAt4R, r=jhpratt
63faf88
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.)
@jhpratt jhpratt mentioned this pull request Apr 16, 2026
Rollup of 18 pull requests #155380
Merged
@RalfJung

RalfJung commented Apr 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There's an unresolved comment further up. It's not blocking but @CAD97 please make sure to take care of it post-landing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rust-bors Bot pushed a commit that referenced this pull request Apr 16, 2026
@bors
Auto merge of #155380 - jhpratt:rollup-j1e7DVL, r=jhpratt
7af3402
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.)
@rust-bors
rust-bors Bot merged commit 2beaa60 into rust-lang:main Apr 16, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@rustbot rustbot added this to the 1.97.0 milestone Apr 16, 2026
rust-timer added a commit that referenced this pull request Apr 16, 2026
@rust-timer
Unrolled build for #154604
761bdb0
Rollup merge of #154604 - CAD97:abort-immediate, r=scottmcm

abort in core

Implements `core::process::abort_immediate` as a wrapper around `intrinsics::abort`.

- tracking issue: #154601

(This PR used to also add `core::process::abort`, but that's been deferred to a later addition.)
zihan0822 pushed a commit to zihan0822/rust-clippy that referenced this pull request Apr 30, 2026
@bors
Auto merge of #155380 - jhpratt:rollup-j1e7DVL, r=jhpratt
8bc1aa3
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.)
@CAD97
CAD97 deleted the abort-immediate branch June 23, 2026 02:56
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Aug 17, 2026
@bors
Auto merge of #155380 - jhpratt:rollup-j1e7DVL, r=jhpratt
a502b0f
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.)
@clarfonthey clarfonthey added the A-process Area: `std::process` (note: `std::env` is A-env) label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@RalfJung RalfJung RalfJung left review comments
@bjorn3 bjorn3 bjorn3 left review comments
+1 more reviewer
@jyn514 jyn514 jyn514 left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@scottmcm scottmcm

Labels

A-process Area: `std::process` (note: `std::env` is A-env) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Projects

None yet

Milestone

1.97.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@CAD97 @rustbot @RalfJung @rust-log-analyzer @bjorn3 @anforowicz @scottmcm @jyn514 @clarfonthey
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.