Remove support for extern "rust-intrinsic"
blocks #132735
Open
Description
opened on Nov 7, 2024
We currently have two ways to declare symbols that are invoked as intrinsics. The old way:
extern "rust-intrinsic" {
fn unreachable() -> !;
}
The new way, which supports giving a "fallback body" that will be used for backends that do not have the intrinsic implemented:
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
unsafe fn unreachable() -> ! { unreachable!() }
The goal of this issue is to remove support for the old style, and consistently use the new style.
- Port the remaining
extern "rust-intrinsic"
intrinsics inlibrary
to the new style, updating them using the pattern described above. This can be a PR on its own. - Port the uses of
extern "rust-intrinsic"
insrc/tools/miri
andtests/ui/simd
to the new style. In fact, these can use the even newer style (which can't be used inlibrary
yet because of bootstraping):
#[rustc_intrinsic]
unsafe fn unreachable();
- Remove support for
extern "rust-intrinsic"
blocks from the compiler -- in particular, remove this. AFAIK these are also the only extern blocks that support generics, so there might be more things that can be cleaned up here. (@compiler-errors or @oli-obk might know more about that.) A lot of tests will need updating; you can grep forrust-intrinsic
to find them all. They should all be ported to the new style, similar to the PR in step 2.
Metadata
Assignees
Labels
Category: PRs that clean code up or issues documenting cleanup.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Activity