Skip to content

Commit 91c0724

Browse files
committed
Silently ignore cargo::rustc-check-cfg to avoid MSRV annoyance
1 parent 9d23d30 commit 91c0724

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

src/cargo/core/compiler/custom_build.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,10 +916,8 @@ impl BuildOutput {
916916
if extra_check_cfg {
917917
check_cfgs.push(value.to_string());
918918
} else {
919-
warnings.push(format!(
920-
"{}{} requires -Zcheck-cfg flag",
921-
syntax_prefix, key
922-
));
919+
// silently ignoring the instruction to try to
920+
// minimise MSRV annoyance when stabilizing -Zcheck-cfg
923921
}
924922
}
925923
"rustc-env" => {

src/cargo/util/config/target.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,8 @@ fn parse_links_overrides(
207207
let list = value.list(key)?;
208208
output.check_cfgs.extend(list.iter().map(|v| v.0.clone()));
209209
} else {
210-
config.shell().warn(format!(
211-
"target config `{}.{}` requires -Zcheck-cfg flag",
212-
target_key, key
213-
))?;
210+
// silently ignoring the instruction to try to
211+
// minimise MSRV annoyance when stabilizing -Zcheck-cfg
214212
}
215213
}
216214
"rustc-env" => {

tests/testsuite/check_cfg.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,7 @@ fn build_script_override_feature_gate() {
471471
.build();
472472

473473
p.cargo("check")
474-
.with_stderr_contains(
475-
"warning: target config[..]rustc-check-cfg[..] requires -Zcheck-cfg flag",
476-
)
474+
.with_stderr_does_not_contain("warning: [..]rustc-check-cfg[..]")
477475
.run();
478476
}
479477

@@ -555,7 +553,7 @@ fn build_script_feature_gate() {
555553
.build();
556554

557555
p.cargo("check")
558-
.with_stderr_contains("warning[..]cargo::rustc-check-cfg requires -Zcheck-cfg flag")
556+
.with_stderr_does_not_contain("warning: [..]rustc-check-cfg[..]")
559557
.with_status(0)
560558
.run();
561559
}

0 commit comments

Comments
 (0)