Skip to content

Commit a16fc10

Browse files
authored
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` 🎅
2 parents a62f245 + 6f19bd0 commit a16fc10

File tree

14 files changed

+18
-26
lines changed

14 files changed

+18
-26
lines changed

tests/run-make/dump-ice-to-disk/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn extract_exactly_one_ice_file<P: AsRef<Path>>(name: &'static str, dir: P) -> I
8383

8484
fn main() {
8585
// Establish baseline ICE message.
86-
let mut default_ice_dump = OnceCell::new();
86+
let default_ice_dump = OnceCell::new();
8787
run_in_tmpdir(|| {
8888
rustc().env("RUSTC_ICE", cwd()).input("lib.rs").arg("-Ztreat-err-as-bug=1").run_fail();
8989
let dump = extract_exactly_one_ice_file("baseline", cwd());

tests/run-make/embed-source-dwarf/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::collections::HashMap;
1010
use std::path::PathBuf;
1111
use std::rc::Rc;
1212

13-
use gimli::{AttributeValue, EndianRcSlice, Reader, RunTimeEndian};
13+
use gimli::{EndianRcSlice, Reader, RunTimeEndian};
1414
use object::{Object, ObjectSection};
1515
use run_make_support::{gimli, object, rfs, rustc};
1616

tests/run-make/import-macro-verbatim/verbatim.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Include a file by concating the verbatim path using `/` instead of `\`
1+
//! Include a file by concatenating the verbatim path using `/` instead of `\`
22
33
include!(concat!(env!("VERBATIM_DIR"), "/include/include.txt"));
44
fn main() {

tests/run-make/libstd-no-protected/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use run_make_support::object::Endianness;
88
use run_make_support::object::read::archive::ArchiveFile;
99
use run_make_support::object::read::elf::{FileHeader as _, SectionHeader as _};
10-
use run_make_support::rfs::{read, read_dir};
10+
use run_make_support::rfs::read;
1111
use run_make_support::{has_prefix, has_suffix, object, path, rustc, shallow_find_files, target};
1212

1313
type FileHeader = run_make_support::object::elf::FileHeader64<Endianness>;

tests/run-make/libtest-thread-limit/rmake.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
// Reason: this should be ignored in cg_clif (Cranelift) CI and anywhere
1616
// else that uses panic=abort.
1717

18-
use std::ffi::{self, CStr, CString};
19-
use std::path::PathBuf;
20-
21-
use run_make_support::{libc, run, rustc};
18+
use run_make_support::{libc, rustc};
2219

2320
fn main() {
2421
rustc().input("test.rs").arg("--test").run();

tests/run-make/llvm-outputs/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ fn main() {
99
let mut path_ir = PathBuf::new();
1010
run_in_tmpdir(|| {
1111
let p = cwd();
12-
path_bc = p.join("nonexistant_dir_bc");
13-
path_ir = p.join("nonexistant_dir_ir");
12+
path_bc = p.join("nonexistent_dir_bc");
13+
path_ir = p.join("nonexistent_dir_ir");
1414
rustc().input("-").stdin_buf("fn main() {}").out_dir(&path_bc).emit("llvm-bc").run();
1515
rustc().input("-").stdin_buf("fn main() {}").out_dir(&path_ir).emit("llvm-ir").run();
1616
assert!(path_bc.exists());

tests/run-make/missing-unstable-trait-bound/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Ensure that on stable we don't suggest restricting with an unsafe trait and we continue
77
// mentioning the rest of the obligation chain.
88

9-
use run_make_support::{diff, rust_lib_name, rustc};
9+
use run_make_support::{diff, rustc};
1010

1111
fn main() {
1212
let out = rustc()

tests/run-make/musl-default-linking/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn main() {
4848
let default = &target_spec["crt-static-default"];
4949

5050
// If the value is `null`, then the default to dynamically link from
51-
// musl_base was not overriden.
51+
// musl_base was not overridden.
5252
if default.is_null() {
5353
continue;
5454
}

tests/run-make/no-alloc-shim/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// Tracking issue: https://github.com/rust-lang/rust/issues/128602
1414
// Discussion: https://github.com/rust-lang/rust/pull/128407#discussion_r1702439172
1515

16-
use run_make_support::{cc, cwd, has_extension, has_prefix, run, rustc, shallow_find_files};
16+
use run_make_support::{cc, has_extension, has_prefix, run, rustc, shallow_find_files};
1717

1818
fn main() {
1919
rustc().input("foo.rs").crate_type("bin").emit("obj").panic("abort").run();

tests/run-make/no-builtins-lto/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// The rlib produced by a no_builtins crate should be explicitely linked
1+
// The rlib produced by a no_builtins crate should be explicitly linked
22
// during compilation, and as a result be present in the linker arguments.
33
// See the comments inside this file for more details.
44
// See https://github.com/rust-lang/rust/pull/35637

tests/run-make/remove-dir-all-race/rmake.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//@ ignore-windows
22

33
// This test attempts to make sure that running `remove_dir_all`
4-
// doesn't result in a NotFound error one of the files it
4+
// doesn't result in a NotFound error if one of the files it
55
// is deleting is deleted concurrently.
66
//
77
// The windows implementation for `remove_dir_all` is significantly
88
// more complicated, and has not yet been brought up to par with
99
// the implementation on other platforms, so this test is marked as
10-
// `ignore-windows` until someone more expirenced with windows can
10+
// `ignore-windows` until someone more experienced with windows can
1111
// sort that out.
1212

1313
use std::fs::remove_dir_all;
@@ -27,13 +27,12 @@ fn main() {
2727
write("outer/inner.txt", b"sometext");
2828

2929
thread::scope(|scope| {
30-
let t1 = scope.spawn(|| {
30+
scope.spawn(|| {
3131
thread::sleep(Duration::from_nanos(i));
3232
remove_dir_all("outer").unwrap();
3333
});
3434

35-
let race_happened_ref = &race_happened;
36-
let t2 = scope.spawn(|| {
35+
scope.spawn(|| {
3736
let r1 = remove_dir_all("outer/inner");
3837
let r2 = remove_dir_all("outer/inner.txt");
3938
if r1.is_ok() && r2.is_err() {
@@ -44,10 +43,10 @@ fn main() {
4443

4544
assert!(!Path::new("outer").exists());
4645

47-
// trying to remove a nonexistant top-level directory should
46+
// trying to remove a nonexistent top-level directory should
4847
// still result in an error.
4948
let Err(err) = remove_dir_all("outer") else {
50-
panic!("removing nonexistant dir did not result in an error");
49+
panic!("removing nonexistent dir did not result in an error");
5150
};
5251
assert_eq!(err.kind(), std::io::ErrorKind::NotFound);
5352
}

tests/run-make/rustdoc-map-file/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// This test ensures that all items from `foo` are correctly generated into the `redirect-map.json`
22
// file with `--generate-redirect-map` rustdoc option.
33

4-
use std::path::Path;
5-
64
use run_make_support::rfs::read_to_string;
75
use run_make_support::{path, rustdoc, serde_json};
86

tests/run-make/rustdoc-output-stdout/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// This test verifies that rustdoc `-o -` prints JSON on stdout and doesn't generate
22
// a JSON file.
33

4-
use std::path::PathBuf;
5-
64
use run_make_support::path_helpers::{cwd, has_extension, read_dir_entries_recursive};
75
use run_make_support::{rustdoc, serde_json};
86

tests/run-make/symbol-visibility/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Dynamic libraries on Rust used to export a very high amount of symbols,
22
// going as far as filling the output with mangled names and generic function
33
// names. After the rework of #38117, this test checks that no mangled Rust symbols
4-
// are exported, and that generics are only shown if explicitely requested.
4+
// are exported, and that generics are only shown if explicitly requested.
55
// See https://github.com/rust-lang/rust/issues/37530
66

77
use run_make_support::object::read::Object;

0 commit comments

Comments
 (0)