about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-12-23 14:44:22 +0100
committerGitHub <noreply@github.com>2024-12-23 14:44:22 +0100
commita16fc10f231f0a01ccaa065b8cfb6484d5d31017 (patch)
treece0b7bf2b21104bf26f7b522d87b53867a06fb4f
parenta62f245fb76c751855177ff17917c549717424af (diff)
parent6f19bd08b07b590ff20a2285c3dc4938d3e37447 (diff)
downloadrust-a16fc10f231f0a01ccaa065b8cfb6484d5d31017.tar.gz
rust-a16fc10f231f0a01ccaa065b8cfb6484d5d31017.zip
Rollup merge of #134680 - lqd:run-make-cleanup, r=jieyouxu
Clean up a few rmake tests

Now I'm aware it's a bit late to start participating in the Advent of Tests, but here are a few cleanups in the rmake tests to put under the 🎄 anyways. A handful of unused imports, some warnings, and a couple typos.

r? `@jieyouxu` 🎅
-rw-r--r--tests/run-make/dump-ice-to-disk/rmake.rs2
-rw-r--r--tests/run-make/embed-source-dwarf/rmake.rs2
-rw-r--r--tests/run-make/import-macro-verbatim/verbatim.rs2
-rw-r--r--tests/run-make/libstd-no-protected/rmake.rs2
-rw-r--r--tests/run-make/libtest-thread-limit/rmake.rs5
-rw-r--r--tests/run-make/llvm-outputs/rmake.rs4
-rw-r--r--tests/run-make/missing-unstable-trait-bound/rmake.rs2
-rw-r--r--tests/run-make/musl-default-linking/rmake.rs2
-rw-r--r--tests/run-make/no-alloc-shim/rmake.rs2
-rw-r--r--tests/run-make/no-builtins-lto/rmake.rs2
-rw-r--r--tests/run-make/remove-dir-all-race/rmake.rs13
-rw-r--r--tests/run-make/rustdoc-map-file/rmake.rs2
-rw-r--r--tests/run-make/rustdoc-output-stdout/rmake.rs2
-rw-r--r--tests/run-make/symbol-visibility/rmake.rs2
14 files changed, 18 insertions, 26 deletions
diff --git a/tests/run-make/dump-ice-to-disk/rmake.rs b/tests/run-make/dump-ice-to-disk/rmake.rs
index 15f35eb2d3d..a7a98d31f50 100644
--- a/tests/run-make/dump-ice-to-disk/rmake.rs
+++ b/tests/run-make/dump-ice-to-disk/rmake.rs
@@ -83,7 +83,7 @@ fn extract_exactly_one_ice_file<P: AsRef<Path>>(name: &'static str, dir: P) -> I
 
 fn main() {
     // Establish baseline ICE message.
-    let mut default_ice_dump = OnceCell::new();
+    let default_ice_dump = OnceCell::new();
     run_in_tmpdir(|| {
         rustc().env("RUSTC_ICE", cwd()).input("lib.rs").arg("-Ztreat-err-as-bug=1").run_fail();
         let dump = extract_exactly_one_ice_file("baseline", cwd());
diff --git a/tests/run-make/embed-source-dwarf/rmake.rs b/tests/run-make/embed-source-dwarf/rmake.rs
index c7106967a85..0aae07ff2e6 100644
--- a/tests/run-make/embed-source-dwarf/rmake.rs
+++ b/tests/run-make/embed-source-dwarf/rmake.rs
@@ -10,7 +10,7 @@ use std::collections::HashMap;
 use std::path::PathBuf;
 use std::rc::Rc;
 
-use gimli::{AttributeValue, EndianRcSlice, Reader, RunTimeEndian};
+use gimli::{EndianRcSlice, Reader, RunTimeEndian};
 use object::{Object, ObjectSection};
 use run_make_support::{gimli, object, rfs, rustc};
 
diff --git a/tests/run-make/import-macro-verbatim/verbatim.rs b/tests/run-make/import-macro-verbatim/verbatim.rs
index 56a83673c1f..0123a4a7e22 100644
--- a/tests/run-make/import-macro-verbatim/verbatim.rs
+++ b/tests/run-make/import-macro-verbatim/verbatim.rs
@@ -1,4 +1,4 @@
-//! Include a file by concating the verbatim path using `/` instead of `\`
+//! Include a file by concatenating the verbatim path using `/` instead of `\`
 
 include!(concat!(env!("VERBATIM_DIR"), "/include/include.txt"));
 fn main() {
diff --git a/tests/run-make/libstd-no-protected/rmake.rs b/tests/run-make/libstd-no-protected/rmake.rs
index 3bba59a8f4d..4091406d46e 100644
--- a/tests/run-make/libstd-no-protected/rmake.rs
+++ b/tests/run-make/libstd-no-protected/rmake.rs
@@ -7,7 +7,7 @@
 use run_make_support::object::Endianness;
 use run_make_support::object::read::archive::ArchiveFile;
 use run_make_support::object::read::elf::{FileHeader as _, SectionHeader as _};
-use run_make_support::rfs::{read, read_dir};
+use run_make_support::rfs::read;
 use run_make_support::{has_prefix, has_suffix, object, path, rustc, shallow_find_files, target};
 
 type FileHeader = run_make_support::object::elf::FileHeader64<Endianness>;
diff --git a/tests/run-make/libtest-thread-limit/rmake.rs b/tests/run-make/libtest-thread-limit/rmake.rs
index fe14d2c046c..817328cd3c3 100644
--- a/tests/run-make/libtest-thread-limit/rmake.rs
+++ b/tests/run-make/libtest-thread-limit/rmake.rs
@@ -15,10 +15,7 @@
 // Reason: this should be ignored in cg_clif (Cranelift) CI and anywhere
 // else that uses panic=abort.
 
-use std::ffi::{self, CStr, CString};
-use std::path::PathBuf;
-
-use run_make_support::{libc, run, rustc};
+use run_make_support::{libc, rustc};
 
 fn main() {
     rustc().input("test.rs").arg("--test").run();
diff --git a/tests/run-make/llvm-outputs/rmake.rs b/tests/run-make/llvm-outputs/rmake.rs
index 632e9a09ba5..2ce31b260a1 100644
--- a/tests/run-make/llvm-outputs/rmake.rs
+++ b/tests/run-make/llvm-outputs/rmake.rs
@@ -9,8 +9,8 @@ fn main() {
     let mut path_ir = PathBuf::new();
     run_in_tmpdir(|| {
         let p = cwd();
-        path_bc = p.join("nonexistant_dir_bc");
-        path_ir = p.join("nonexistant_dir_ir");
+        path_bc = p.join("nonexistent_dir_bc");
+        path_ir = p.join("nonexistent_dir_ir");
         rustc().input("-").stdin_buf("fn main() {}").out_dir(&path_bc).emit("llvm-bc").run();
         rustc().input("-").stdin_buf("fn main() {}").out_dir(&path_ir).emit("llvm-ir").run();
         assert!(path_bc.exists());
diff --git a/tests/run-make/missing-unstable-trait-bound/rmake.rs b/tests/run-make/missing-unstable-trait-bound/rmake.rs
index 20f77f7c9aa..3f76c65247d 100644
--- a/tests/run-make/missing-unstable-trait-bound/rmake.rs
+++ b/tests/run-make/missing-unstable-trait-bound/rmake.rs
@@ -6,7 +6,7 @@
 // Ensure that on stable we don't suggest restricting with an unsafe trait and we continue
 // mentioning the rest of the obligation chain.
 
-use run_make_support::{diff, rust_lib_name, rustc};
+use run_make_support::{diff, rustc};
 
 fn main() {
     let out = rustc()
diff --git a/tests/run-make/musl-default-linking/rmake.rs b/tests/run-make/musl-default-linking/rmake.rs
index b6d428d3f27..d203595a447 100644
--- a/tests/run-make/musl-default-linking/rmake.rs
+++ b/tests/run-make/musl-default-linking/rmake.rs
@@ -48,7 +48,7 @@ fn main() {
         let default = &target_spec["crt-static-default"];
 
         // If the value is `null`, then the default to dynamically link from
-        // musl_base was not overriden.
+        // musl_base was not overridden.
         if default.is_null() {
             continue;
         }
diff --git a/tests/run-make/no-alloc-shim/rmake.rs b/tests/run-make/no-alloc-shim/rmake.rs
index c398a3177df..d61ef5de8c5 100644
--- a/tests/run-make/no-alloc-shim/rmake.rs
+++ b/tests/run-make/no-alloc-shim/rmake.rs
@@ -13,7 +13,7 @@
 // Tracking issue: https://github.com/rust-lang/rust/issues/128602
 // Discussion: https://github.com/rust-lang/rust/pull/128407#discussion_r1702439172
 
-use run_make_support::{cc, cwd, has_extension, has_prefix, run, rustc, shallow_find_files};
+use run_make_support::{cc, has_extension, has_prefix, run, rustc, shallow_find_files};
 
 fn main() {
     rustc().input("foo.rs").crate_type("bin").emit("obj").panic("abort").run();
diff --git a/tests/run-make/no-builtins-lto/rmake.rs b/tests/run-make/no-builtins-lto/rmake.rs
index 8e0c3a63649..56fdfde42f0 100644
--- a/tests/run-make/no-builtins-lto/rmake.rs
+++ b/tests/run-make/no-builtins-lto/rmake.rs
@@ -1,4 +1,4 @@
-// The rlib produced by a no_builtins crate should be explicitely linked
+// The rlib produced by a no_builtins crate should be explicitly linked
 // during compilation, and as a result be present in the linker arguments.
 // See the comments inside this file for more details.
 // See https://github.com/rust-lang/rust/pull/35637
diff --git a/tests/run-make/remove-dir-all-race/rmake.rs b/tests/run-make/remove-dir-all-race/rmake.rs
index 03c94b76127..32abca92424 100644
--- a/tests/run-make/remove-dir-all-race/rmake.rs
+++ b/tests/run-make/remove-dir-all-race/rmake.rs
@@ -1,13 +1,13 @@
 //@ ignore-windows
 
 // This test attempts to make sure that running `remove_dir_all`
-// doesn't result in a NotFound error one of the files it
+// doesn't result in a NotFound error if one of the files it
 // is deleting is deleted concurrently.
 //
 // The windows implementation for `remove_dir_all` is significantly
 // more complicated, and has not yet been brought up to par with
 // the implementation on other platforms, so this test is marked as
-// `ignore-windows` until someone more expirenced with windows can
+// `ignore-windows` until someone more experienced with windows can
 // sort that out.
 
 use std::fs::remove_dir_all;
@@ -27,13 +27,12 @@ fn main() {
             write("outer/inner.txt", b"sometext");
 
             thread::scope(|scope| {
-                let t1 = scope.spawn(|| {
+                scope.spawn(|| {
                     thread::sleep(Duration::from_nanos(i));
                     remove_dir_all("outer").unwrap();
                 });
 
-                let race_happened_ref = &race_happened;
-                let t2 = scope.spawn(|| {
+                scope.spawn(|| {
                     let r1 = remove_dir_all("outer/inner");
                     let r2 = remove_dir_all("outer/inner.txt");
                     if r1.is_ok() && r2.is_err() {
@@ -44,10 +43,10 @@ fn main() {
 
             assert!(!Path::new("outer").exists());
 
-            // trying to remove a nonexistant top-level directory should
+            // trying to remove a nonexistent top-level directory should
             // still result in an error.
             let Err(err) = remove_dir_all("outer") else {
-                panic!("removing nonexistant dir did not result in an error");
+                panic!("removing nonexistent dir did not result in an error");
             };
             assert_eq!(err.kind(), std::io::ErrorKind::NotFound);
         }
diff --git a/tests/run-make/rustdoc-map-file/rmake.rs b/tests/run-make/rustdoc-map-file/rmake.rs
index d7e3510fe31..50dcc603c02 100644
--- a/tests/run-make/rustdoc-map-file/rmake.rs
+++ b/tests/run-make/rustdoc-map-file/rmake.rs
@@ -1,8 +1,6 @@
 // This test ensures that all items from `foo` are correctly generated into the `redirect-map.json`
 // file with `--generate-redirect-map` rustdoc option.
 
-use std::path::Path;
-
 use run_make_support::rfs::read_to_string;
 use run_make_support::{path, rustdoc, serde_json};
 
diff --git a/tests/run-make/rustdoc-output-stdout/rmake.rs b/tests/run-make/rustdoc-output-stdout/rmake.rs
index bcf5e4d9723..d2fd0451163 100644
--- a/tests/run-make/rustdoc-output-stdout/rmake.rs
+++ b/tests/run-make/rustdoc-output-stdout/rmake.rs
@@ -1,8 +1,6 @@
 // This test verifies that rustdoc `-o -` prints JSON on stdout and doesn't generate
 // a JSON file.
 
-use std::path::PathBuf;
-
 use run_make_support::path_helpers::{cwd, has_extension, read_dir_entries_recursive};
 use run_make_support::{rustdoc, serde_json};
 
diff --git a/tests/run-make/symbol-visibility/rmake.rs b/tests/run-make/symbol-visibility/rmake.rs
index f84e63ef74e..ec936bc3b07 100644
--- a/tests/run-make/symbol-visibility/rmake.rs
+++ b/tests/run-make/symbol-visibility/rmake.rs
@@ -1,7 +1,7 @@
 // Dynamic libraries on Rust used to export a very high amount of symbols,
 // going as far as filling the output with mangled names and generic function
 // names. After the rework of #38117, this test checks that no mangled Rust symbols
-// are exported, and that generics are only shown if explicitely requested.
+// are exported, and that generics are only shown if explicitly requested.
 // See https://github.com/rust-lang/rust/issues/37530
 
 use run_make_support::object::read::Object;