Description
Proposal
Refactor the compiler to remove all #![feature(...)]
uses from rustc crates residing in compiler/
.
From a high level point of view, rustc itself deals in data: text in, binary out. This process doesn't need nightly features from a technical perspective, yet the compiler uses many. When rustc was created, Rust was an unstable language and lacked many features to build large powerful programs. Now, 5 years after 1.0, many stable features have arrived, and there is a growing ecosystem featuring multiple large codebases in stable.
Making compiler/
crates build on stable has a set of benefits:
-
Easier onboarding of outside contributors from the stable Rust ecosystem as they have to learn less new features/mannerisms.
-
Unstable features sometimes still have rough edges and soundness holes. You need to be aware of these issues when using them, making it harder for contributors.
-
Unlock usage of beta std by rustc without needing cfg(bootstrap) (also proposed by @matklad here). Already a subset of this proposal unlocks that (only removing unstable std/library features).
-
As rustc is crates.io-ified, outside users might want to use components of rustc. Often those outside users want to use stable themselves
Note that I don't propose:
-
moving off beta to e.g. stable compilers as the default stage0 and supporting bootstrap from the last 2 compiler versions instead of the last one only (
cargo
can do this already). -
stopping use of nightly features altogether. std crates and tests still need nightly features.
RUSTC_BOOTSTRAP
is still needed for those, although maybe x.py won't set it forcompiler/
crates any more to enforce the rule (alternatively one can think about enforcing it in tidy).
I have prior experience with moving nushell to stable: nushell/nushell#362 . I can help out in the implementation of this proposal, if it's wanted.
Mentors or Reviewers
If you have a reviewer or mentor in mind for this work, mention then
here. You can put your own name here if you are planning to mentor the
work.
Process
The main points of the Major Change Process is as follows:
- File an issue describing the proposal.
- A compiler team member or contributor who is knowledgeable in the area can second by writing
@rustbot second
.- Finding a "second" suffices for internal changes. If however you are proposing a new public-facing feature, such as a
-C flag
, then full team check-off is required. - Compiler team members can initiate a check-off via
@rfcbot fcp merge
on either the MCP or the PR.
- Finding a "second" suffices for internal changes. If however you are proposing a new public-facing feature, such as a
- Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.
You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.