Skip to content

Fix warnings in rmake tests on x86_64-unknown-linux-gnu #128937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs
Original file line number Diff line number Diff line change
@@ -3,8 +3,6 @@
// Check that the `CURRENT_RUSTC_VERSION` placeholder is correctly replaced by the current
// `rustc` version and the `since` property in feature stability gating is properly respected.

use std::path::PathBuf;

use run_make_support::{aux_build, rfs, rustc, source_root};

fn main() {
2 changes: 0 additions & 2 deletions tests/run-make/arguments-non-c-like-enum/rmake.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,6 @@
use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib_name};

pub fn main() {
use std::path::Path;

rustc().input("nonclike.rs").crate_type("staticlib").run();
cc().input("test.c")
.input(static_lib_name("nonclike"))
2 changes: 0 additions & 2 deletions tests/run-make/c-link-to-rust-staticlib/rmake.rs
Original file line number Diff line number Diff line change
@@ -3,8 +3,6 @@

//@ ignore-cross-compile

use std::fs;

use run_make_support::rfs::remove_file;
use run_make_support::{cc, extra_c_flags, run, rustc, static_lib_name};

4 changes: 1 addition & 3 deletions tests/run-make/comment-section/rmake.rs
Original file line number Diff line number Diff line change
@@ -7,9 +7,7 @@
// FIXME(jieyouxu): check cross-compile setup
//@ ignore-cross-compile

use std::path::PathBuf;

use run_make_support::{cwd, env_var, llvm_readobj, rfs, run_in_tmpdir, rustc};
use run_make_support::{cwd, env_var, llvm_readobj, rfs, rustc};

fn main() {
let target = env_var("TARGET");
2 changes: 1 addition & 1 deletion tests/run-make/compressed-debuginfo/rmake.rs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

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

use run_make_support::{assert_contains, cmd, llvm_readobj, run_in_tmpdir, rustc};
use run_make_support::{assert_contains, llvm_readobj, run_in_tmpdir, rustc};

fn check_compression(compression: &str, to_find: &str) {
run_in_tmpdir(|| {
2 changes: 1 addition & 1 deletion tests/run-make/const_fn_mir/rmake.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

//@ needs-unwind

use run_make_support::{cwd, diff, rustc};
use run_make_support::{diff, rustc};

fn main() {
rustc().input("main.rs").emit("mir").output("dump-actual.mir").run();
5 changes: 2 additions & 3 deletions tests/run-make/crate-loading/rmake.rs
Original file line number Diff line number Diff line change
@@ -2,14 +2,13 @@
//@ ignore-wasm32
//@ ignore-wasm64

use run_make_support::rfs::copy;
use run_make_support::{assert_contains, rust_lib_name, rustc};
use run_make_support::{rust_lib_name, rustc};

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

let out = rustc()
rustc()
.input("multiple-dep-versions.rs")
.extern_("dependency", rust_lib_name("dependency"))
.extern_("dep_2_reexport", rust_lib_name("dependency2"))
1 change: 0 additions & 1 deletion tests/run-make/dylib-soname/rmake.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
//@ only-linux
//@ ignore-cross-compile

use run_make_support::regex::Regex;
use run_make_support::{cmd, run_in_tmpdir, rustc};

fn main() {
2 changes: 1 addition & 1 deletion tests/run-make/extern-flag-disambiguates/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ ignore-cross-compile

use run_make_support::{cwd, run, rustc};
use run_make_support::{run, rustc};

// Attempt to build this dependency tree:
//
2 changes: 1 addition & 1 deletion tests/run-make/ice-dep-cannot-find-dep/rmake.rs
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
// If we used `rustc` the additional '-L rmake_out' option would allow rustc to
// actually find the crate.

use run_make_support::{bare_rustc, rfs, rust_lib_name, rustc};
use run_make_support::{bare_rustc, rust_lib_name, rustc};

fn main() {
rustc().crate_name("a").crate_type("rlib").input("a.rs").arg("--verbose").run();
2 changes: 1 addition & 1 deletion tests/run-make/incr-test-moved-file/rmake.rs
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
//@ ignore-nvptx64-nvidia-cuda
// FIXME: can't find crate for 'std'

use run_make_support::{rfs, rust_lib_name, rustc};
use run_make_support::{rfs, rustc};

fn main() {
rfs::create_dir("incr");
2 changes: 0 additions & 2 deletions tests/run-make/incremental-debugger-visualizer/rmake.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@
// (in this case, foo.py and foo.natvis) are picked up when compiling incrementally.
// See https://github.com/rust-lang/rust/pull/111641

use std::io::Read;

use run_make_support::{invalid_utf8_contains, invalid_utf8_not_contains, rfs, rustc};

fn main() {
2 changes: 1 addition & 1 deletion tests/run-make/lto-readonly-lib/rmake.rs
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@

//@ ignore-cross-compile

use run_make_support::{rfs, run, rust_lib_name, rustc, test_while_readonly};
use run_make_support::{run, rust_lib_name, rustc, test_while_readonly};

fn main() {
rustc().input("lib.rs").run();
2 changes: 1 addition & 1 deletion tests/run-make/multiple-emits/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use run_make_support::{cwd, path, rustc};
use run_make_support::{path, rustc};

fn main() {
rustc().input("foo.rs").emit("asm,llvm-ir").output("out").run();
2 changes: 1 addition & 1 deletion tests/run-make/naked-symbol-visibility/rmake.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
use run_make_support::object::read::{File, Object, Symbol};
use run_make_support::object::ObjectSymbol;
use run_make_support::targets::is_windows;
use run_make_support::{dynamic_lib_name, env_var, rfs, rustc};
use run_make_support::{dynamic_lib_name, rfs, rustc};

fn main() {
let rdylib_name = dynamic_lib_name("a_rust_dylib");
2 changes: 1 addition & 1 deletion tests/run-make/non-unicode-in-incremental-dir/rmake.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ fn main() {
match std::fs::create_dir(&non_unicode) {
// If an error occurs, check if creating a directory with a valid Unicode name would
// succeed.
Err(e) if std::fs::create_dir("valid_unicode").is_ok() => {
Err(_) if std::fs::create_dir("valid_unicode").is_ok() => {
// Filesystem doesn't appear support non-Unicode paths.
return;
}
44 changes: 22 additions & 22 deletions tests/run-make/output-type-permutations/rmake.rs
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "asm-emit".to_string(),
},
|| {
@@ -123,7 +123,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "asm-emit2".to_string(),
},
|| {
@@ -133,7 +133,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "asm-emit3".to_string(),
},
|| {
@@ -144,7 +144,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "llvm-ir-emit".to_string(),
},
|| {
@@ -154,7 +154,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "llvm-ir-emit2".to_string(),
},
|| {
@@ -164,7 +164,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "llvm-ir-emit3".to_string(),
},
|| {
@@ -175,7 +175,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "llvm-bc-emit".to_string(),
},
|| {
@@ -185,7 +185,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "llvm-bc-emit2".to_string(),
},
|| {
@@ -195,7 +195,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "llvm-bc-emit3".to_string(),
},
|| {
@@ -206,7 +206,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "obj-emit".to_string(),
},
|| {
@@ -216,7 +216,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "obj-emit2".to_string(),
},
|| {
@@ -226,7 +226,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "obj-emit3".to_string(),
},
|| {
@@ -268,7 +268,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "rlib".to_string(),
},
|| {
@@ -278,7 +278,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "rlib2".to_string(),
},
|| {
@@ -288,7 +288,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "rlib3".to_string(),
},
|| {
@@ -375,7 +375,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "staticlib".to_string(),
},
|| {
@@ -385,7 +385,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "staticlib2".to_string(),
},
|| {
@@ -395,7 +395,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["foo"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "staticlib3".to_string(),
},
|| {
@@ -449,7 +449,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["ir", rust_lib_name("bar")],
allowed_files: s![],
allowed_files: vec![],
test_dir: "rlib-ir".to_string(),
},
|| {
@@ -466,7 +466,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["ir", "asm", "bc", "obj", "link"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "staticlib-all".to_string(),
},
|| {
@@ -484,7 +484,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["ir", "asm", "bc", "obj", "link"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "staticlib-all2".to_string(),
},
|| {
@@ -523,7 +523,7 @@ fn main() {
assert_expected_output_files(
Expectations {
expected_files: s!["bar.bc", rust_lib_name("bar"), "foo.bc"],
allowed_files: s![],
allowed_files: vec![],
test_dir: "rlib-emits".to_string(),
},
|| {
1 change: 0 additions & 1 deletion tests/run-make/print-check-cfg/rmake.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ extern crate run_make_support;

use std::collections::HashSet;
use std::iter::FromIterator;
use std::ops::Deref;

use run_make_support::rustc;

2 changes: 0 additions & 2 deletions tests/run-make/print-native-static-libs/rmake.rs
Original file line number Diff line number Diff line change
@@ -12,8 +12,6 @@
//@ ignore-cross-compile
//@ ignore-wasm

use std::io::BufRead;

use run_make_support::{is_msvc, rustc};

fn main() {
4 changes: 1 addition & 3 deletions tests/run-make/redundant-libs/rmake.rs
Original file line number Diff line number Diff line change
@@ -11,9 +11,7 @@
//@ ignore-cross-compile
// Reason: the compiled binary is executed

use run_make_support::{
build_native_dynamic_lib, build_native_static_lib, cwd, is_msvc, rfs, run, rustc,
};
use run_make_support::{build_native_dynamic_lib, build_native_static_lib, run, rustc};

fn main() {
build_native_dynamic_lib("foo");
2 changes: 1 addition & 1 deletion tests/run-make/reproducible-build-2/rmake.rs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
// 2. When the sysroot gets copied, some symlinks must be re-created,
// which is a privileged action on Windows.

use run_make_support::{bin_name, rfs, rust_lib_name, rustc};
use run_make_support::{rfs, rust_lib_name, rustc};

fn main() {
// test 1: fat lto
2 changes: 1 addition & 1 deletion tests/run-make/reset-codegen-1/rmake.rs
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@

use std::path::Path;

use run_make_support::{bin_name, rfs, rustc};
use run_make_support::{bin_name, rustc};

fn compile(output_file: &str, emit: Option<&str>) {
let mut rustc = rustc();
2 changes: 1 addition & 1 deletion tests/run-make/rlib-format-packed-bundled-libs-3/rmake.rs
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
// See https://github.com/rust-lang/rust/pull/105601

use run_make_support::{
build_native_static_lib, is_msvc, llvm_ar, regex, rfs, rust_lib_name, rustc, static_lib_name,
build_native_static_lib, llvm_ar, regex, rfs, rust_lib_name, rustc, static_lib_name,
};

//@ ignore-cross-compile
2 changes: 1 addition & 1 deletion tests/run-make/run-in-tmpdir-self-test/rmake.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
//! when returning from the closure.
use std::fs;
use std::path::{Path, PathBuf};
use std::path::PathBuf;

use run_make_support::{cwd, run_in_tmpdir};

2 changes: 0 additions & 2 deletions tests/run-make/rust-lld-by-default-nightly/rmake.rs
Original file line number Diff line number Diff line change
@@ -6,8 +6,6 @@
//@ ignore-stable
//@ only-x86_64-unknown-linux-gnu

use std::process::Output;

use run_make_support::regex::Regex;
use run_make_support::rustc;

2 changes: 1 addition & 1 deletion tests/run-make/rust-lld-compress-debug-sections/rmake.rs
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

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

use run_make_support::{assert_contains, cmd, llvm_readobj, run_in_tmpdir, rustc};
use run_make_support::{assert_contains, llvm_readobj, run_in_tmpdir, rustc};

fn check_compression(compression: &str, to_find: &str) {
run_in_tmpdir(|| {
2 changes: 0 additions & 2 deletions tests/run-make/rust-lld-custom-target/rmake.rs
Original file line number Diff line number Diff line change
@@ -8,8 +8,6 @@
//@ needs-rust-lld
//@ only-x86_64-unknown-linux-gnu

use std::process::Output;

use run_make_support::regex::Regex;
use run_make_support::rustc;

2 changes: 0 additions & 2 deletions tests/run-make/rust-lld/rmake.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,6 @@
//@ needs-rust-lld
//@ ignore-s390x lld does not yet support s390x as target

use std::process::Output;

use run_make_support::regex::Regex;
use run_make_support::{is_msvc, rustc};

12 changes: 5 additions & 7 deletions tests/run-make/rustdoc-io-error/rmake.rs
Original file line number Diff line number Diff line change
@@ -14,22 +14,20 @@
// `mkfs.ext4 -d`, as well as mounting a loop device for the rootfs.
//@ ignore-windows - the `set_readonly` functions doesn't work on folders.

use std::fs;

use run_make_support::{path, rustdoc};
use run_make_support::{path, rfs, rustdoc};

fn main() {
let out_dir = path("rustdoc-io-error");
let output = fs::create_dir(&out_dir).unwrap();
let mut permissions = fs::metadata(&out_dir).unwrap().permissions();
rfs::create_dir(&out_dir);
let mut permissions = rfs::metadata(&out_dir).permissions();
let original_permissions = permissions.clone();

permissions.set_readonly(true);
fs::set_permissions(&out_dir, permissions).unwrap();
rfs::set_permissions(&out_dir, permissions);

let output = rustdoc().input("foo.rs").output(&out_dir).env("RUST_BACKTRACE", "1").run_fail();

fs::set_permissions(&out_dir, original_permissions).unwrap();
rfs::set_permissions(&out_dir, original_permissions);

output
.assert_exit_code(1)
2 changes: 1 addition & 1 deletion tests/run-make/rustdoc-scrape-examples-remap/scrape.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::path::Path;

use run_make_support::{htmldocck, rfs, rustc, rustdoc, source_root};
use run_make_support::{htmldocck, rfs, rustc, rustdoc};

pub fn scrape(extra_args: &[&str]) {
let out_dir = Path::new("rustdoc");
5 changes: 1 addition & 4 deletions tests/run-make/sepcomp-cci-copies/rmake.rs
Original file line number Diff line number Diff line change
@@ -4,10 +4,7 @@
// created for each source module (see `rustc_const_eval::monomorphize::partitioning`).
// See https://github.com/rust-lang/rust/pull/16367

use run_make_support::{
count_regex_matches_in_files_with_extension, cwd, has_extension, regex, rfs, rustc,
shallow_find_files,
};
use run_make_support::{count_regex_matches_in_files_with_extension, regex, rustc};

fn main() {
rustc().input("cci_lib.rs").run();
5 changes: 1 addition & 4 deletions tests/run-make/sepcomp-inlining/rmake.rs
Original file line number Diff line number Diff line change
@@ -5,10 +5,7 @@
// in only one compilation unit.
// See https://github.com/rust-lang/rust/pull/16367

use run_make_support::{
count_regex_matches_in_files_with_extension, cwd, has_extension, regex, rfs, rustc,
shallow_find_files,
};
use run_make_support::{count_regex_matches_in_files_with_extension, regex, rustc};

fn main() {
rustc().input("foo.rs").emit("llvm-ir").codegen_units(3).arg("-Zinline-in-all-cgus").run();
5 changes: 1 addition & 4 deletions tests/run-make/sepcomp-separate/rmake.rs
Original file line number Diff line number Diff line change
@@ -3,10 +3,7 @@
// wind up in three different compilation units.
// See https://github.com/rust-lang/rust/pull/16367

use run_make_support::{
count_regex_matches_in_files_with_extension, cwd, has_extension, regex, rfs, rustc,
shallow_find_files,
};
use run_make_support::{count_regex_matches_in_files_with_extension, regex, rustc};

fn main() {
rustc().input("foo.rs").emit("llvm-ir").codegen_units(3).run();