Skip to content

Commit 78b4caf

Browse files
authored
Rollup merge of #125573 - GuillaumeGomez:migrate-allow-warnings-cmdline-stability, r=jieyouxu
Migrate `run-make/allow-warnings-cmdline-stability` to `rmake.rs` Part of #121876. r? ``@jieyouxu``
2 parents 713c852 + 404d47e commit 78b4caf

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

src/tools/run-make-support/src/lib.rs

+11
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,17 @@ pub fn recursive_diff(dir1: impl AsRef<Path>, dir2: impl AsRef<Path>) {
268268
}
269269
}
270270

271+
/// Check that `haystack` does not contain `needle`. Panic otherwise.
272+
pub fn assert_not_contains(haystack: &str, needle: &str) {
273+
if haystack.contains(needle) {
274+
eprintln!("=== HAYSTACK ===");
275+
eprintln!("{}", haystack);
276+
eprintln!("=== NEEDLE ===");
277+
eprintln!("{}", needle);
278+
panic!("needle was unexpectedly found in haystack");
279+
}
280+
}
281+
271282
/// Implement common helpers for command wrappers. This assumes that the command wrapper is a struct
272283
/// containing a `cmd: Command` field and a `output` function. The provided helpers are:
273284
///

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
run-make/allocator-shim-circular-deps/Makefile
22
run-make/allow-non-lint-warnings-cmdline/Makefile
3-
run-make/allow-warnings-cmdline-stability/Makefile
43
run-make/archive-duplicate-names/Makefile
54
run-make/atomic-lock-free/Makefile
65
run-make/bare-outfile/Makefile

tests/run-make/allow-warnings-cmdline-stability/Makefile

-16
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Test that `-Awarnings` suppresses warnings for unstable APIs.
2+
3+
use run_make_support::{assert_not_contains, rustc};
4+
5+
fn main() {
6+
rustc().input("bar.rs").run();
7+
let output = rustc().input("foo.rs").arg("-Awarnings").run();
8+
9+
assert_not_contains(&String::from_utf8(output.stdout).unwrap(), "warning");
10+
assert_not_contains(&String::from_utf8(output.stderr).unwrap(), "warning");
11+
}

0 commit comments

Comments
 (0)