Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fmease opened this issue Nov 15, 2023 · 4 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@fmease
Copy link
Member

fmease commented Nov 15, 2023

Uplifted from #117819 (comment).

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.

@fmease fmease added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Nov 15, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 15, 2023
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 15, 2023
@lukas-code
Copy link
Member

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

FWIW, there is already the unstable_features lint. The docs say it's deprecated, but is appears to work perfectly fine.

@bjorn3
Copy link
Member

bjorn3 commented Nov 15, 2023

And we have -Zallow-feature to explicitly list the set of allowed unstable features. Could be set in the rustc wrapper of bootstrap depending on the crate name.

@clubby789
Copy link
Contributor

clubby789 commented Nov 15, 2023

The docs say it's deprecated, but is appears to work perfectly fine

Seems like this note was added in #26417, when use of unstable features was turned into a compiler error rather than a lint

@fmease
Copy link
Member Author

fmease commented Nov 15, 2023

Okay, I guess I'm gonna submit a t-lang-nominated PR later undeprecating unstable_features and applying it to the two affected crates.

@fmease fmease self-assigned this Nov 20, 2023
TaKO8Ki added a commit to TaKO8Ki/rust that referenced this issue Jan 21, 2024
…tc-crates, r=WaffleLapkin

Undeprecate lint `unstable_features` and make use of it in the compiler

See also rust-lang#117937.

r? compiler
@fmease fmease removed their assignment Jan 22, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 22, 2024
…tc-crates, r=WaffleLapkin

Undeprecate lint `unstable_features` and make use of it in the compiler

See also rust-lang#117937.

r? compiler
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 22, 2024
…tc-crates, r=WaffleLapkin

Undeprecate lint `unstable_features` and make use of it in the compiler

See also rust-lang#117937.

r? compiler
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 22, 2024
…tc-crates, r=WaffleLapkin

Undeprecate lint `unstable_features` and make use of it in the compiler

See also rust-lang#117937.

r? compiler
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jan 22, 2024
Rollup merge of rust-lang#118639 - fmease:deny-features-in-stable-rustc-crates, r=WaffleLapkin

Undeprecate lint `unstable_features` and make use of it in the compiler

See also rust-lang#117937.

r? compiler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

5 participants