Skip to content

Commit cfaaf1c

Browse files
committed
test(compile): Show warnings=allow on denied lint
1 parent 1511866 commit cfaaf1c

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

tests/testsuite/warning_override.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,27 @@ fn requires_nightly() {
4040
.run();
4141
}
4242

43+
#[cargo_test]
44+
fn always_show_error_diags() {
45+
let p = make_project_with_rustc_warning();
46+
p.cargo("check")
47+
.masquerade_as_nightly_cargo(&["warnings"])
48+
.env("RUSTFLAGS", "-Dunused_variables")
49+
.arg("-Zwarnings")
50+
.arg("--config")
51+
.arg("build.warnings='allow'")
52+
.with_stderr_data(str![[r#"
53+
[CHECKING] foo v0.0.1 ([ROOT]/foo)
54+
[ERROR] could not compile `foo` (bin "foo")
55+
56+
Caused by:
57+
process didn't exit successfully: `rustc --crate-name foo --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=400 --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=cbc5c944f9a4e5cb -C extra-filename=-b1a006a0c806d1bb --out-dir [ROOT]/foo/target/debug/deps -L dependency=[ROOT]/foo/target/debug/deps -Dunused_variables` ([EXIT_STATUS]: 1)
58+
59+
"#]])
60+
.with_status(101)
61+
.run();
62+
}
63+
4364
#[cargo_test]
4465
fn clippy() {
4566
let p = project()

0 commit comments

Comments
 (0)