Add miri to the well known conditional compilation names and values
This commit is contained in:
parent
b97dc20784
commit
6781016421
@ -1072,6 +1072,7 @@ fn fill_well_known_names(&mut self) {
|
||||
// NOTE: This should be kept in sync with `default_configuration` and
|
||||
// `fill_well_known_values`
|
||||
const WELL_KNOWN_NAMES: &[Symbol] = &[
|
||||
// rustc
|
||||
sym::unix,
|
||||
sym::windows,
|
||||
sym::target_os,
|
||||
@ -1091,9 +1092,12 @@ fn fill_well_known_names(&mut self) {
|
||||
sym::debug_assertions,
|
||||
sym::proc_macro,
|
||||
sym::test,
|
||||
sym::feature,
|
||||
// rustdoc
|
||||
sym::doc,
|
||||
sym::doctest,
|
||||
sym::feature,
|
||||
// miri
|
||||
sym::miri,
|
||||
];
|
||||
|
||||
// We only insert well-known names if `names()` was activated
|
||||
@ -1128,13 +1132,14 @@ fn fill_well_known_values(&mut self) {
|
||||
|
||||
// No-values
|
||||
for name in [
|
||||
sym::unix,
|
||||
sym::windows,
|
||||
sym::debug_assertions,
|
||||
sym::proc_macro,
|
||||
sym::test,
|
||||
sym::doc,
|
||||
sym::miri,
|
||||
sym::unix,
|
||||
sym::test,
|
||||
sym::doctest,
|
||||
sym::windows,
|
||||
sym::proc_macro,
|
||||
sym::debug_assertions,
|
||||
sym::target_thread_local,
|
||||
] {
|
||||
self.values_valid.entry(name).or_default();
|
||||
|
@ -891,6 +891,7 @@
|
||||
minnumf32,
|
||||
minnumf64,
|
||||
mips_target_feature,
|
||||
miri,
|
||||
misc,
|
||||
mmx_reg,
|
||||
modifiers,
|
||||
|
@ -193,7 +193,6 @@ pub unsafe fn setup(_build: &mut crate::Build) {}
|
||||
(None, "bootstrap", None),
|
||||
(Some(Mode::Rustc), "parallel_compiler", None),
|
||||
(Some(Mode::ToolRustc), "parallel_compiler", None),
|
||||
(Some(Mode::Std), "miri", None),
|
||||
(Some(Mode::Std), "stdarch_intel_sde", None),
|
||||
(Some(Mode::Std), "no_fp_fmt_parse", None),
|
||||
(Some(Mode::Std), "no_global_oom_handling", None),
|
||||
|
@ -24,4 +24,10 @@ fn unix_misspell() {}
|
||||
#[cfg(unix)]
|
||||
fn unix() {}
|
||||
|
||||
#[cfg(miri)]
|
||||
fn miri() {}
|
||||
|
||||
#[cfg(doc)]
|
||||
fn doc() {}
|
||||
|
||||
fn main() {}
|
||||
|
@ -25,4 +25,18 @@ fn unix_with_value() {}
|
||||
#[cfg(unix)]
|
||||
fn unix() {}
|
||||
|
||||
#[cfg(miri = "miri")]
|
||||
//~^ WARNING unexpected `cfg` condition value
|
||||
fn miri_with_value() {}
|
||||
|
||||
#[cfg(miri)]
|
||||
fn miri() {}
|
||||
|
||||
#[cfg(doc = "linux")]
|
||||
//~^ WARNING unexpected `cfg` condition value
|
||||
fn doc_with_value() {}
|
||||
|
||||
#[cfg(doc)]
|
||||
fn doc() {}
|
||||
|
||||
fn main() {}
|
||||
|
@ -29,5 +29,25 @@ LL | #[cfg(unix = "aa")]
|
||||
|
|
||||
= note: no expected value for `unix`
|
||||
|
||||
warning: 3 warnings emitted
|
||||
warning: unexpected `cfg` condition value
|
||||
--> $DIR/well-known-values.rs:28:7
|
||||
|
|
||||
LL | #[cfg(miri = "miri")]
|
||||
| ^^^^---------
|
||||
| |
|
||||
| help: remove the value
|
||||
|
|
||||
= note: no expected value for `miri`
|
||||
|
||||
warning: unexpected `cfg` condition value
|
||||
--> $DIR/well-known-values.rs:35:7
|
||||
|
|
||||
LL | #[cfg(doc = "linux")]
|
||||
| ^^^----------
|
||||
| |
|
||||
| help: remove the value
|
||||
|
|
||||
= note: no expected value for `doc`
|
||||
|
||||
warning: 5 warnings emitted
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user