dtolnay / rustversion

Conditional compilation according to rustc compiler version
Apache License 2.0
336 stars 15 forks source link

RFE: detect RUSTC_BOOTSTRAP #2

Closed cuviper closed 5 years ago

cuviper commented 5 years ago

Since #[rustc::nightly] includes dev builds, it sort of encompasses the situations where it's possible to use unstable features. How would you feel about checking the RUSTC_BOOTSTRAP environment variable in that set? Or perhaps that should be a distinct grouping, something like #[rustc::unstable]?

dtolnay commented 5 years ago

I would prefer not to get involved with RUSTC_BOOTSTRAP unless it would specifically help with bootstrapping rustc. I am not familiar with how the bootstrap currently works but I imagine it has alternative ways to accomplish enabling features -- for example here in the libc crate.

cuviper commented 5 years ago

Ok, that's understandable. I have sometimes cheated with RUSTC_BOOTSTRAP in private projects just to get #[bench] with a stable compiler, but I know that's not really kosher.