rust-lang / rust-lang/rust

Extend `minicore` with intrinsics and use it to replace `#[rustc_intrinsic]` in tests

Open
#139,918 8 comments 1 reaction 1 assignee View on GitHub

@rptr is already working on this.

Since May 21, 2025.

A-lang-item A-test-infra-minicore A-testsuite C-cleanup E-easy T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

We now have a "minicore" at tests/auxiliary/minicore.rs with some lang items to be shared among no_core tests. However, there's a lot more that could reasonably be added there, and this does not require a lot of experience with how rustc works so it could be a good first issue as well.

To find a candidate test, grep the test suite for #[rustc_intrinsic]. If this test also uses #![no_core], changes are high that this is a good candidate. If the test does not yet use minicore, first port it to minicore by adding //@ add-core-stubs and:

extern crate minicore;
use minicore::*;

See e.g. tests/assembly/simd-intrinsic-mask-reduce.rs for an example.
All of the existing lang items (things with #[lang] attributes) in the test should be removed now; if they don't yet exist in minicore, they should be added there. Then also remove the #[rustc_intrinsic] declarations from the test and add them to minicore if they do not yet exist there.

Cc @jieyouxu

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.