Skip to content

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

@RalfJung

Description

@RalfJung

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lang-itemArea: Language itemsA-testsuiteArea: The testsuite used to check the correctness of rustcC-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions