about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-16 14:12:12 -0400
committerOneirical <manchot@videotron.ca>2024-07-17 16:11:11 -0400
commit3ba62f0a63c6b0092b6fec3bbc8877045073d827 (patch)
tree8ae8277f5611e979bb362f30f644c42944007eb0
parent890ef1180b96683602ecd7ce0fe19a431d6474e2 (diff)
downloadrust-3ba62f0a63c6b0092b6fec3bbc8877045073d827.tar.gz
rust-3ba62f0a63c6b0092b6fec3bbc8877045073d827.zip
rewrite unstable-flag-required to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/missing-crate-dependency/rmake.rs4
-rw-r--r--tests/run-make/unstable-flag-required/Makefile4
-rw-r--r--tests/run-make/unstable-flag-required/rmake.rs12
4 files changed, 14 insertions, 7 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 349f0e3169f..282b615c5bf 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -120,5 +120,4 @@ run-make/test-benches/Makefile
 run-make/thumb-none-cortex-m/Makefile
 run-make/thumb-none-qemu/Makefile
 run-make/translation/Makefile
-run-make/unstable-flag-required/Makefile
 run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile
diff --git a/tests/run-make/missing-crate-dependency/rmake.rs b/tests/run-make/missing-crate-dependency/rmake.rs
index ab916fc6b61..dae77032f7d 100644
--- a/tests/run-make/missing-crate-dependency/rmake.rs
+++ b/tests/run-make/missing-crate-dependency/rmake.rs
@@ -3,12 +3,12 @@
 // in a dependency chain.
 // See https://github.com/rust-lang/rust/issues/12146
 
-use run_make_support::{fs_wrapper, rust_lib_name, rustc};
+use run_make_support::{rfs, rust_lib_name, rustc};
 
 fn main() {
     rustc().crate_type("rlib").input("crateA.rs").run();
     rustc().crate_type("rlib").input("crateB.rs").run();
-    fs_wrapper::remove_file(rust_lib_name("crateA"));
+    rfs::remove_file(rust_lib_name("crateA"));
     // Ensure that crateC fails to compile, as the crateA dependency is missing.
     rustc()
         .input("crateC.rs")
diff --git a/tests/run-make/unstable-flag-required/Makefile b/tests/run-make/unstable-flag-required/Makefile
deleted file mode 100644
index 17dd15b079c..00000000000
--- a/tests/run-make/unstable-flag-required/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../tools.mk
-
-all:
-	$(RUSTDOC) --output-format=json x.html 2>&1 | diff - output-format-json.stderr
diff --git a/tests/run-make/unstable-flag-required/rmake.rs b/tests/run-make/unstable-flag-required/rmake.rs
new file mode 100644
index 00000000000..c521436c203
--- /dev/null
+++ b/tests/run-make/unstable-flag-required/rmake.rs
@@ -0,0 +1,12 @@
+// The flag `--output-format` is unauthorized on beta and stable releases, which led
+// to confusion for maintainers doing testing on nightly. Tying it to an unstable flag
+// elucidates this, and this test checks that `--output-format` cannot be passed on its
+// own.
+// See https://github.com/rust-lang/rust/pull/82497
+
+use run_make_support::{diff, rustdoc};
+
+fn main() {
+    let out = rustdoc().output_format("json").input("x.html").run_fail().stderr_utf8();
+    diff().expected_file("output-format-json.stderr").actual_text("actual-json", out).run();
+}