diff --git a/src/cargo/core/compiler/custom_build.rs b/src/cargo/core/compiler/custom_build.rs index 065f012b94f..153ef3aa666 100644 --- a/src/cargo/core/compiler/custom_build.rs +++ b/src/cargo/core/compiler/custom_build.rs @@ -916,10 +916,8 @@ impl BuildOutput { if extra_check_cfg { check_cfgs.push(value.to_string()); } else { - warnings.push(format!( - "{}{} requires -Zcheck-cfg flag", - syntax_prefix, key - )); + // silently ignoring the instruction to try to + // minimise MSRV annoyance when stabilizing -Zcheck-cfg } } "rustc-env" => { diff --git a/src/cargo/util/config/target.rs b/src/cargo/util/config/target.rs index 7081cfd0784..dab4af2c72f 100644 --- a/src/cargo/util/config/target.rs +++ b/src/cargo/util/config/target.rs @@ -208,10 +208,8 @@ fn parse_links_overrides( let list = value.list(key)?; output.check_cfgs.extend(list.iter().map(|v| v.0.clone())); } else { - gctx.shell().warn(format!( - "target config `{}.{}` requires -Zcheck-cfg flag", - target_key, key - ))?; + // silently ignoring the instruction to try to + // minimise MSRV annoyance when stabilizing -Zcheck-cfg } } "rustc-env" => { diff --git a/tests/testsuite/check_cfg.rs b/tests/testsuite/check_cfg.rs index c91c4c93135..3f96451e0bd 100644 --- a/tests/testsuite/check_cfg.rs +++ b/tests/testsuite/check_cfg.rs @@ -471,9 +471,7 @@ fn build_script_override_feature_gate() { .build(); p.cargo("check") - .with_stderr_contains( - "warning: target config[..]rustc-check-cfg[..] requires -Zcheck-cfg flag", - ) + .with_stderr_does_not_contain("warning: [..]rustc-check-cfg[..]") .run(); } @@ -555,7 +553,7 @@ fn build_script_feature_gate() { .build(); p.cargo("check") - .with_stderr_contains("warning[..]cargo::rustc-check-cfg requires -Zcheck-cfg flag") + .with_stderr_does_not_contain("warning: [..]rustc-check-cfg[..]") .with_status(0) .run(); }