diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index 600ca06fcdf3a..b29f7be2c5a94 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -255,7 +255,6 @@ run-make/unknown-mod-stdin/Makefile run-make/unstable-flag-required/Makefile run-make/use-suggestions-rust-2018/Makefile run-make/used-cdylib-macos/Makefile -run-make/used/Makefile run-make/volatile-intrinsics/Makefile run-make/wasm-exceptions-nostd/Makefile run-make/wasm-override-linker/Makefile diff --git a/tests/run-make/used/Makefile b/tests/run-make/used/Makefile deleted file mode 100644 index e80eb9e402086..0000000000000 --- a/tests/run-make/used/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -include ../tools.mk - -# ignore-windows-msvc - -all: - $(RUSTC) -C opt-level=3 --emit=obj used.rs - nm $(TMPDIR)/used.o | $(CGREP) FOO diff --git a/tests/run-make/used/rmake.rs b/tests/run-make/used/rmake.rs new file mode 100644 index 0000000000000..7f1c61915daba --- /dev/null +++ b/tests/run-make/used/rmake.rs @@ -0,0 +1,16 @@ +//! This test checks rustdoc `-` (stdin) handling + +use run_make_support::{rustc, tmp_dir}; +use std::process::Command; + +fn main() { + rustc().opt_level("3").emit("obj").input("used.rs").run(); + + let output = Command::new("nm").arg(tmp_dir().join("used.o")).output().unwrap(); + + assert!(output.status.success()); + let stdout = String::from_utf8_lossy(&output.stdout); + if !stdout.contains("FOO") { + panic!("`FOO` not found in stdout:\n`{stdout}`"); + } +}