Assume the effects of RUSTC_BOOTSTRAP in sysroot#151684
Assume the effects of RUSTC_BOOTSTRAP in sysroot#151684CrooseGit wants to merge 1 commit intorust-lang:mainfrom
Conversation
When the input to rustc is within rustc's sysroot, then unstable features should be enabled as they would be with `RUSTC_BOOTSTRAP=1`.
Quoting the docs, doesn't this let you write a test that checks this works? |
This patch is implemented such that |
|
If we decode to take the approach from rust-lang/rfcs#3874 (comment), then rustc-build-sysroot can set RUSTC_BOOTSTRAP and rustc shouldn't implicitly enable RUSTC_BOOTSTRAP for source files inside the sysroot. Also the sysroot needs to be compiled with |
cc rust-lang/rfcs#3874
In the build-std: always RFC, it is proposed that
RUSTC_BOOTSTRAPshould be implied for compilation of any crate located in the sysroot. As such, Cargo would not need to setRUSTC_BOOTSTRAPfor build-std, but also external projects like Rust for Linux that buildcorefrom therust-srccomponent could do so on a stable toolchain.This functionality is only intended for use with unmodified standard library sources, and that should probably be document somewhere but I'm not sure where -
RUSTC_BOOTSTRAPis mentioned in the unstable book, maybe with that? It might make more sense in the rustc book but there's not an obvious spot.As rust-lang/rfcs#3874 is not yet accepted, if this warrants an MCP to be implemented in the interim, then I'd be happy to submit one.
It is unclear exactly how to test this, as it would require rustc be from a stable toolchain to test the relevant behaviours, and that's not how the test suite is set up. None of the current tests for
RUSTC_BOOTSTRAPcan be adapted for this.r? @wesleywiser