Skip to content

Rename //@ add-core-stubs to //@ add-minicore #930

@RalfJung

Description

@RalfJung

Proposal

To use minicore in a test (so that it can be made #![no_core] and run on all targets), one currently has to do:

//@ add-core-stubs
extern crate minicore;
use minicore::*;

It is very strange that we mix the terms "core-stubs" and "minicore" here. Apparently this goes back to this message

I'd maybe call it add-core-stubs or something because if you don't know what minicore is then that might be confusing, but I don't mind having a convenience thing like this in compiletest

However, the minicore name is still present, so it is unclear to me how mixing two names helps.

Minicore is a fairly established name at this point:

$ find compiler/ src/ tests/ -name "*mini*core*"
compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs
compiler/rustc_codegen_cranelift/example/mini_core.rs
compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs
compiler/rustc_codegen_gcc/example/mini_core.rs
src/doc/rustc-dev-guide/src/tests/minicore.md
src/tools/rust-analyzer/crates/test-utils/src/minicore.rs
tests/auxiliary/minicore.rs
tests/codegen-llvm/compiletest-self-test/minicore-smoke-test.rs
tests/assembly-llvm/compiletest-self-test/use-minicore-no-run.rs
tests/ui/traits/const-traits/minicore-drop-fail.stderr
tests/ui/traits/const-traits/minicore-drop-without-feature-gate.no.stderr
tests/ui/traits/const-traits/minicore-deref-fail.rs
tests/ui/traits/const-traits/minicore-drop-without-feature-gate.rs
tests/ui/traits/const-traits/minicore-fn-fail.rs
tests/ui/traits/const-traits/minicore-fn-fail.stderr
tests/ui/traits/const-traits/auxiliary/minicore.rs
tests/ui/traits/const-traits/minicore-const-fn-early-bound.rs
tests/ui/traits/const-traits/minicore-deref-fail.stderr
tests/ui/traits/const-traits/minicore-drop-fail.rs
tests/ui/traits/const-traits/minicore-works.rs
tests/ui/compiletest-self-test/minicore-smoke-test.rs

It is also a reasonably descriptive name I would argue.

So IMO we should just stick to that name and use it consistently, and rename all related compiletest directives from core-subst to minicore.

Also see prior discussion.

History

Mentors or Reviewers

@jieyouxu

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member who is knowledgeable in the area can second by writing @rustbot second or kickoff a team FCP with @rfcbot fcp $RESOLUTION.
  • Once an MCP is seconded, the Final Comment Period begins.
    • Final Comment Period lasts for 10 days after all outstanding concerns are solved.
    • Outstanding concerns will block the Final Comment Period from finishing. Once all concerns are resolved, the 10 day countdown is restarted.
    • If no concerns are raised after 10 days since the resolution of the last outstanding concern, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerAdd this label so rfcbot knows to poll the compiler teamfinal-comment-periodThe FCP has started, most (if not all) team members are in agreementmajor-changeA proposal to make a major change to rustcto-announceAnnounce this issue on triage meeting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions