rust-lang / rust-lang/rust

Bootstrap: Build compiler crates that ought to compile on stable without `RUSTC_BOOTSTRAP=1`

Open
#117,937 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-enhancement T-bootstrap
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Uplifted from https://github.com/rust-lang/rust/pull/117819#issuecomment-1806851136.

There exist some compiler crates (e.g., rustc_lexer and rustc_parse_format) which ought not use unstable features since they are used by other tools like rust-analyzer which has a “no nightly” policy. The aforementioned crates do contain comments informing rustc devs about it, they are easy to miss however.

If bootstrap were to compile those crates without RUSTC_BOOTSTRAP=1, the issue of PRs accidentally adding #![feature]s to such crates could be prevented in the future.

Alternative: A rustc-internal or regular lint triggering on #![feature]s.

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.

Research direction

Start by tracing bootstrap's build path for compiler crates such as rustc_lexer and rustc_parse_format, focusing on where RUSTC_BOOTSTRAP=1 is applied. Determine how those crates can be checked without the environment override, or how a lint could detect added #![feature] attributes. Done means the relevant crates are prevented from gaining unstable features accidentally.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.