Skip to content

Commit bb35b88

Browse files
Rollup merge of #128937 - lqd:clean-rmake-tests, r=jieyouxu
Fix warnings in rmake tests on `x86_64-unknown-linux-gnu` r? `@jieyouxu` This PR fixes some warnings I saw in rmake tests. I didn't deny more warnings in this PR until `@jieyouxu` gives their opinion, but maybe we should actually deny all warnings in `rmake.rs` files? I've also only looked at non-ignored tests on `x86_64-unknown-linux-gnu`, and denying warnings would require a try build for all targets 😓.
2 parents 5b6379a + dcd6170 commit bb35b88

File tree

33 files changed

+49
-83
lines changed

33 files changed

+49
-83
lines changed

tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// Check that the `CURRENT_RUSTC_VERSION` placeholder is correctly replaced by the current
44
// `rustc` version and the `since` property in feature stability gating is properly respected.
55

6-
use std::path::PathBuf;
7-
86
use run_make_support::{aux_build, rfs, rustc, source_root};
97

108
fn main() {

tests/run-make/arguments-non-c-like-enum/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib_name};
55

66
pub fn main() {
7-
use std::path::Path;
8-
97
rustc().input("nonclike.rs").crate_type("staticlib").run();
108
cc().input("test.c")
119
.input(static_lib_name("nonclike"))

tests/run-make/c-link-to-rust-staticlib/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
//@ ignore-cross-compile
55

6-
use std::fs;
7-
86
use run_make_support::rfs::remove_file;
97
use run_make_support::{cc, extra_c_flags, run, rustc, static_lib_name};
108

tests/run-make/comment-section/rmake.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
// FIXME(jieyouxu): check cross-compile setup
88
//@ ignore-cross-compile
99

10-
use std::path::PathBuf;
11-
12-
use run_make_support::{cwd, env_var, llvm_readobj, rfs, run_in_tmpdir, rustc};
10+
use run_make_support::{cwd, env_var, llvm_readobj, rfs, rustc};
1311

1412
fn main() {
1513
let target = env_var("TARGET");

tests/run-make/compressed-debuginfo/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// FIXME: This test isn't comprehensive and isn't covering all possible combinations.
77

8-
use run_make_support::{assert_contains, cmd, llvm_readobj, run_in_tmpdir, rustc};
8+
use run_make_support::{assert_contains, llvm_readobj, run_in_tmpdir, rustc};
99

1010
fn check_compression(compression: &str, to_find: &str) {
1111
run_in_tmpdir(|| {

tests/run-make/const_fn_mir/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//@ needs-unwind
44

5-
use run_make_support::{cwd, diff, rustc};
5+
use run_make_support::{diff, rustc};
66

77
fn main() {
88
rustc().input("main.rs").emit("mir").output("dump-actual.mir").run();

tests/run-make/crate-loading/rmake.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
//@ ignore-wasm32
33
//@ ignore-wasm64
44

5-
use run_make_support::rfs::copy;
6-
use run_make_support::{assert_contains, rust_lib_name, rustc};
5+
use run_make_support::{rust_lib_name, rustc};
76

87
fn main() {
98
rustc().input("multiple-dep-versions-1.rs").run();
109
rustc().input("multiple-dep-versions-2.rs").extra_filename("2").metadata("2").run();
1110

12-
let out = rustc()
11+
rustc()
1312
.input("multiple-dep-versions.rs")
1413
.extern_("dependency", rust_lib_name("dependency"))
1514
.extern_("dep_2_reexport", rust_lib_name("dependency2"))

tests/run-make/dylib-soname/rmake.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
//@ only-linux
55
//@ ignore-cross-compile
66

7-
use run_make_support::regex::Regex;
87
use run_make_support::{cmd, run_in_tmpdir, rustc};
98

109
fn main() {

tests/run-make/extern-flag-disambiguates/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ ignore-cross-compile
22

3-
use run_make_support::{cwd, run, rustc};
3+
use run_make_support::{run, rustc};
44

55
// Attempt to build this dependency tree:
66
//

tests/run-make/ice-dep-cannot-find-dep/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// If we used `rustc` the additional '-L rmake_out' option would allow rustc to
1717
// actually find the crate.
1818

19-
use run_make_support::{bare_rustc, rfs, rust_lib_name, rustc};
19+
use run_make_support::{bare_rustc, rust_lib_name, rustc};
2020

2121
fn main() {
2222
rustc().crate_name("a").crate_type("rlib").input("a.rs").arg("--verbose").run();

tests/run-make/incr-test-moved-file/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//@ ignore-nvptx64-nvidia-cuda
1515
// FIXME: can't find crate for 'std'
1616

17-
use run_make_support::{rfs, rust_lib_name, rustc};
17+
use run_make_support::{rfs, rustc};
1818

1919
fn main() {
2020
rfs::create_dir("incr");

tests/run-make/incremental-debugger-visualizer/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// (in this case, foo.py and foo.natvis) are picked up when compiling incrementally.
33
// See https://github.com/rust-lang/rust/pull/111641
44

5-
use std::io::Read;
6-
75
use run_make_support::{invalid_utf8_contains, invalid_utf8_not_contains, rfs, rustc};
86

97
fn main() {

tests/run-make/lto-readonly-lib/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
//@ ignore-cross-compile
99

10-
use run_make_support::{rfs, run, rust_lib_name, rustc, test_while_readonly};
10+
use run_make_support::{run, rust_lib_name, rustc, test_while_readonly};
1111

1212
fn main() {
1313
rustc().input("lib.rs").run();

tests/run-make/multiple-emits/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use run_make_support::{cwd, path, rustc};
1+
use run_make_support::{path, rustc};
22

33
fn main() {
44
rustc().input("foo.rs").emit("asm,llvm-ir").output("out").run();

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use run_make_support::object::read::{File, Object, Symbol};
44
use run_make_support::object::ObjectSymbol;
55
use run_make_support::targets::is_windows;
6-
use run_make_support::{dynamic_lib_name, env_var, rfs, rustc};
6+
use run_make_support::{dynamic_lib_name, rfs, rustc};
77

88
fn main() {
99
let rdylib_name = dynamic_lib_name("a_rust_dylib");

tests/run-make/non-unicode-in-incremental-dir/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() {
88
match std::fs::create_dir(&non_unicode) {
99
// If an error occurs, check if creating a directory with a valid Unicode name would
1010
// succeed.
11-
Err(e) if std::fs::create_dir("valid_unicode").is_ok() => {
11+
Err(_) if std::fs::create_dir("valid_unicode").is_ok() => {
1212
// Filesystem doesn't appear support non-Unicode paths.
1313
return;
1414
}

tests/run-make/output-type-permutations/rmake.rs

+22-22
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fn main() {
113113
assert_expected_output_files(
114114
Expectations {
115115
expected_files: s!["foo"],
116-
allowed_files: s![],
116+
allowed_files: vec![],
117117
test_dir: "asm-emit".to_string(),
118118
},
119119
|| {
@@ -123,7 +123,7 @@ fn main() {
123123
assert_expected_output_files(
124124
Expectations {
125125
expected_files: s!["foo"],
126-
allowed_files: s![],
126+
allowed_files: vec![],
127127
test_dir: "asm-emit2".to_string(),
128128
},
129129
|| {
@@ -133,7 +133,7 @@ fn main() {
133133
assert_expected_output_files(
134134
Expectations {
135135
expected_files: s!["foo"],
136-
allowed_files: s![],
136+
allowed_files: vec![],
137137
test_dir: "asm-emit3".to_string(),
138138
},
139139
|| {
@@ -144,7 +144,7 @@ fn main() {
144144
assert_expected_output_files(
145145
Expectations {
146146
expected_files: s!["foo"],
147-
allowed_files: s![],
147+
allowed_files: vec![],
148148
test_dir: "llvm-ir-emit".to_string(),
149149
},
150150
|| {
@@ -154,7 +154,7 @@ fn main() {
154154
assert_expected_output_files(
155155
Expectations {
156156
expected_files: s!["foo"],
157-
allowed_files: s![],
157+
allowed_files: vec![],
158158
test_dir: "llvm-ir-emit2".to_string(),
159159
},
160160
|| {
@@ -164,7 +164,7 @@ fn main() {
164164
assert_expected_output_files(
165165
Expectations {
166166
expected_files: s!["foo"],
167-
allowed_files: s![],
167+
allowed_files: vec![],
168168
test_dir: "llvm-ir-emit3".to_string(),
169169
},
170170
|| {
@@ -175,7 +175,7 @@ fn main() {
175175
assert_expected_output_files(
176176
Expectations {
177177
expected_files: s!["foo"],
178-
allowed_files: s![],
178+
allowed_files: vec![],
179179
test_dir: "llvm-bc-emit".to_string(),
180180
},
181181
|| {
@@ -185,7 +185,7 @@ fn main() {
185185
assert_expected_output_files(
186186
Expectations {
187187
expected_files: s!["foo"],
188-
allowed_files: s![],
188+
allowed_files: vec![],
189189
test_dir: "llvm-bc-emit2".to_string(),
190190
},
191191
|| {
@@ -195,7 +195,7 @@ fn main() {
195195
assert_expected_output_files(
196196
Expectations {
197197
expected_files: s!["foo"],
198-
allowed_files: s![],
198+
allowed_files: vec![],
199199
test_dir: "llvm-bc-emit3".to_string(),
200200
},
201201
|| {
@@ -206,7 +206,7 @@ fn main() {
206206
assert_expected_output_files(
207207
Expectations {
208208
expected_files: s!["foo"],
209-
allowed_files: s![],
209+
allowed_files: vec![],
210210
test_dir: "obj-emit".to_string(),
211211
},
212212
|| {
@@ -216,7 +216,7 @@ fn main() {
216216
assert_expected_output_files(
217217
Expectations {
218218
expected_files: s!["foo"],
219-
allowed_files: s![],
219+
allowed_files: vec![],
220220
test_dir: "obj-emit2".to_string(),
221221
},
222222
|| {
@@ -226,7 +226,7 @@ fn main() {
226226
assert_expected_output_files(
227227
Expectations {
228228
expected_files: s!["foo"],
229-
allowed_files: s![],
229+
allowed_files: vec![],
230230
test_dir: "obj-emit3".to_string(),
231231
},
232232
|| {
@@ -268,7 +268,7 @@ fn main() {
268268
assert_expected_output_files(
269269
Expectations {
270270
expected_files: s!["foo"],
271-
allowed_files: s![],
271+
allowed_files: vec![],
272272
test_dir: "rlib".to_string(),
273273
},
274274
|| {
@@ -278,7 +278,7 @@ fn main() {
278278
assert_expected_output_files(
279279
Expectations {
280280
expected_files: s!["foo"],
281-
allowed_files: s![],
281+
allowed_files: vec![],
282282
test_dir: "rlib2".to_string(),
283283
},
284284
|| {
@@ -288,7 +288,7 @@ fn main() {
288288
assert_expected_output_files(
289289
Expectations {
290290
expected_files: s!["foo"],
291-
allowed_files: s![],
291+
allowed_files: vec![],
292292
test_dir: "rlib3".to_string(),
293293
},
294294
|| {
@@ -375,7 +375,7 @@ fn main() {
375375
assert_expected_output_files(
376376
Expectations {
377377
expected_files: s!["foo"],
378-
allowed_files: s![],
378+
allowed_files: vec![],
379379
test_dir: "staticlib".to_string(),
380380
},
381381
|| {
@@ -385,7 +385,7 @@ fn main() {
385385
assert_expected_output_files(
386386
Expectations {
387387
expected_files: s!["foo"],
388-
allowed_files: s![],
388+
allowed_files: vec![],
389389
test_dir: "staticlib2".to_string(),
390390
},
391391
|| {
@@ -395,7 +395,7 @@ fn main() {
395395
assert_expected_output_files(
396396
Expectations {
397397
expected_files: s!["foo"],
398-
allowed_files: s![],
398+
allowed_files: vec![],
399399
test_dir: "staticlib3".to_string(),
400400
},
401401
|| {
@@ -449,7 +449,7 @@ fn main() {
449449
assert_expected_output_files(
450450
Expectations {
451451
expected_files: s!["ir", rust_lib_name("bar")],
452-
allowed_files: s![],
452+
allowed_files: vec![],
453453
test_dir: "rlib-ir".to_string(),
454454
},
455455
|| {
@@ -466,7 +466,7 @@ fn main() {
466466
assert_expected_output_files(
467467
Expectations {
468468
expected_files: s!["ir", "asm", "bc", "obj", "link"],
469-
allowed_files: s![],
469+
allowed_files: vec![],
470470
test_dir: "staticlib-all".to_string(),
471471
},
472472
|| {
@@ -484,7 +484,7 @@ fn main() {
484484
assert_expected_output_files(
485485
Expectations {
486486
expected_files: s!["ir", "asm", "bc", "obj", "link"],
487-
allowed_files: s![],
487+
allowed_files: vec![],
488488
test_dir: "staticlib-all2".to_string(),
489489
},
490490
|| {
@@ -523,7 +523,7 @@ fn main() {
523523
assert_expected_output_files(
524524
Expectations {
525525
expected_files: s!["bar.bc", rust_lib_name("bar"), "foo.bc"],
526-
allowed_files: s![],
526+
allowed_files: vec![],
527527
test_dir: "rlib-emits".to_string(),
528528
},
529529
|| {

tests/run-make/print-check-cfg/rmake.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ extern crate run_make_support;
44

55
use std::collections::HashSet;
66
use std::iter::FromIterator;
7-
use std::ops::Deref;
87

98
use run_make_support::rustc;
109

tests/run-make/print-native-static-libs/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
//@ ignore-cross-compile
1313
//@ ignore-wasm
1414

15-
use std::io::BufRead;
16-
1715
use run_make_support::{is_msvc, rustc};
1816

1917
fn main() {

tests/run-make/redundant-libs/rmake.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
//@ ignore-cross-compile
1212
// Reason: the compiled binary is executed
1313

14-
use run_make_support::{
15-
build_native_dynamic_lib, build_native_static_lib, cwd, is_msvc, rfs, run, rustc,
16-
};
14+
use run_make_support::{build_native_dynamic_lib, build_native_static_lib, run, rustc};
1715

1816
fn main() {
1917
build_native_dynamic_lib("foo");

tests/run-make/reproducible-build-2/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// 2. When the sysroot gets copied, some symlinks must be re-created,
1414
// which is a privileged action on Windows.
1515

16-
use run_make_support::{bin_name, rfs, rust_lib_name, rustc};
16+
use run_make_support::{rfs, rust_lib_name, rustc};
1717

1818
fn main() {
1919
// test 1: fat lto

tests/run-make/reset-codegen-1/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
use std::path::Path;
1111

12-
use run_make_support::{bin_name, rfs, rustc};
12+
use run_make_support::{bin_name, rustc};
1313

1414
fn compile(output_file: &str, emit: Option<&str>) {
1515
let mut rustc = rustc();

0 commit comments

Comments
 (0)