From 6ef62438f5804736bd129a93e714671f809f73cb Mon Sep 17 00:00:00 2001 From: Oneirical Date: Tue, 16 Jul 2024 13:24:19 -0400 Subject: [PATCH] rewrite and rename issue-107094 to rmake --- .../tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/issue-107094/Makefile | 7 ------- .../version-verbose-commit-hash/rmake.rs | 20 +++++++++++++++++++ tests/ui/errors/wrong-target-spec.rs | 5 +++++ 4 files changed, 25 insertions(+), 8 deletions(-) delete mode 100644 tests/run-make/issue-107094/Makefile create mode 100644 tests/run-make/version-verbose-commit-hash/rmake.rs diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index 152660f8d219f..852ae38844199 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -43,7 +43,6 @@ run-make/foreign-rust-exceptions/Makefile run-make/incr-add-rust-src-component/Makefile run-make/incr-foreign-head-span/Makefile run-make/interdependent-c-libraries/Makefile -run-make/issue-107094/Makefile run-make/issue-15460/Makefile run-make/issue-18943/Makefile run-make/issue-22131/Makefile diff --git a/tests/run-make/issue-107094/Makefile b/tests/run-make/issue-107094/Makefile deleted file mode 100644 index d614e3e1055c0..0000000000000 --- a/tests/run-make/issue-107094/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# needs-git-hash - -include ../tools.mk - -all: - $(BARE_RUSTC) --version --verbose | $(CGREP) -i -e "commit-hash: [0-9a-f]{40}" "commit-date: [0-9]{4}-[0-9]{2}-[0-9]{2}" - $(BARE_RUSTDOC) --version --verbose | $(CGREP) -i -e "commit-hash: [0-9a-f]{40}" "commit-date: [0-9]{4}-[0-9]{2}-[0-9]{2}" diff --git a/tests/run-make/version-verbose-commit-hash/rmake.rs b/tests/run-make/version-verbose-commit-hash/rmake.rs new file mode 100644 index 0000000000000..733c0e2cdb14f --- /dev/null +++ b/tests/run-make/version-verbose-commit-hash/rmake.rs @@ -0,0 +1,20 @@ +// `--version --verbose` should display the git-commit hashes of rustc and rustdoc, but this +// functionality was lost due to #104184. After this feature was returned by #109981, this +// test ensures it will not be broken again. +// See https://github.com/rust-lang/rust/issues/107094 + +//@ needs-git-hash + +use run_make_support::{bare_rustc, bare_rustdoc, regex}; + +fn main() { + let out_rustc = + bare_rustc().arg("--version").arg("--verbose").run().stdout_utf8().to_lowercase(); + let out_rustdoc = + bare_rustdoc().arg("--version").arg("--verbose").run().stdout_utf8().to_lowercase(); + let re = + regex::Regex::new(r#"commit-hash: [0-9a-f]{40}\ncommit-date: [0-9]{4}-[0-9]{2}-[0-9]{2}"#) + .unwrap(); + assert!(re.is_match(&out_rustc)); + assert!(re.is_match(&out_rustdoc)); +} diff --git a/tests/ui/errors/wrong-target-spec.rs b/tests/ui/errors/wrong-target-spec.rs index d1d0fcc5fa0bd..bc9038c1fab54 100644 --- a/tests/ui/errors/wrong-target-spec.rs +++ b/tests/ui/errors/wrong-target-spec.rs @@ -1,3 +1,8 @@ +// The attentive may note the underscores in the target triple, making it invalid. This test +// checks that such invalid target specs are rejected by the compiler. +// See https://github.com/rust-lang/rust/issues/33329 + +//@ needs-llvm-components: x86 //@ compile-flags: --target x86_64_unknown-linux-musl fn main() {}