Conversation
|
r? @scottmcm rustbot has assigned @scottmcm. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
|
|
Cc @bjorn3 who knows a lot about the alloc shims. |
library/core/src/process.rs
Outdated
| pub mod __default_core_abort { | ||
| #[rustc_std_internal_symbol] | ||
| pub fn __rdl_abort() -> ! { | ||
| super::abort_immediate() | ||
| } | ||
| } |
There was a problem hiding this comment.
This looks like it wants to be an externally defined item...
There was a problem hiding this comment.
EIIs still don’t work on Windows.
There was a problem hiding this comment.
I would stongly prefer waiting until EIIs are ready before we add any more EII like interfaces.
library/core/src/process.rs
Outdated
| } | ||
|
|
||
| __rust_abort() | ||
| } |
There was a problem hiding this comment.
Would you mind adding a Miri test for this, to ensure the symbol dispatch also works there? Ideally with two revisions to cover both the no_std and with_std case. src/tools/miri/tests/fail/shims is probably the right folder for that.
This comment has been minimized.
This comment has been minimized.
| inputs: &[], | ||
| output: AllocatorTy::Never, | ||
| }); | ||
| } |
There was a problem hiding this comment.
The allocator shim is only codegened when liballoc is pulled in.
|
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. |
Thank you for the heads-up.
/cc @DKLoehr from the Chromium Toolchain team as FYI |
|
Given core |
|
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.
"unmangled" you mean libc::abort?
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.)