Skip to content

Commit 3cf2d7b

Browse files
committed
Auto merge of #127000 - Oneirical:no-test-for-the-wicked, r=Kobzol
Migrate `use-suggestions-rust-2018`, `overwrite-input`, `lto-dylib-dep` and `many-crates-but-no-match` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
2 parents 9c3bc80 + b94eae5 commit 3cf2d7b

File tree

12 files changed

+79
-76
lines changed

12 files changed

+79
-76
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-4
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,12 @@ run-make/llvm-ident/Makefile
9393
run-make/long-linker-command-lines-cmd-exe/Makefile
9494
run-make/long-linker-command-lines/Makefile
9595
run-make/longjmp-across-rust/Makefile
96-
run-make/lto-dylib-dep/Makefile
9796
run-make/lto-linkage-used-attr/Makefile
9897
run-make/lto-no-link-whole-rlib/Makefile
9998
run-make/lto-smoke-c/Makefile
10099
run-make/macos-deployment-target/Makefile
101100
run-make/macos-fat-archive/Makefile
102101
run-make/manual-link/Makefile
103-
run-make/many-crates-but-no-match/Makefile
104102
run-make/metadata-dep-info/Makefile
105103
run-make/min-global-align/Makefile
106104
run-make/mingw-export-call-convention/Makefile
@@ -118,7 +116,6 @@ run-make/optimization-remarks-dir-pgo/Makefile
118116
run-make/optimization-remarks-dir/Makefile
119117
run-make/output-type-permutations/Makefile
120118
run-make/override-aliased-flags/Makefile
121-
run-make/overwrite-input/Makefile
122119
run-make/panic-abort-eh_frame/Makefile
123120
run-make/pass-linker-flags-flavor/Makefile
124121
run-make/pass-linker-flags-from-dep/Makefile
@@ -192,7 +189,6 @@ run-make/translation/Makefile
192189
run-make/type-mismatch-same-crate-name/Makefile
193190
run-make/unknown-mod-stdin/Makefile
194191
run-make/unstable-flag-required/Makefile
195-
run-make/use-suggestions-rust-2018/Makefile
196192
run-make/used-cdylib-macos/Makefile
197193
run-make/volatile-intrinsics/Makefile
198194
run-make/wasm-exceptions-nostd/Makefile

tests/run-make/lto-dylib-dep/Makefile

-11
This file was deleted.

tests/run-make/lto-dylib-dep/rmake.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Compiling with link-time-optimizations (LTO) would previously run into an internal
2+
// compiler error (ICE) if a dylib was passed as a required library. This was due to a
3+
// misplaced assert! call in the compiler, which is now removed. This test checks that
4+
// this bug does not make a resurgence and that dylib+lto compilation succeeds.
5+
// See https://github.com/rust-lang/rust/issues/59137
6+
7+
//@ ignore-cross-compile
8+
9+
use run_make_support::{run, rustc};
10+
11+
fn main() {
12+
rustc().input("a_dylib.rs").crate_type("dylib").arg("-Cprefer-dynamic").run();
13+
rustc().input("main.rs").arg("-Clto").run();
14+
run("main");
15+
}

tests/run-make/many-crates-but-no-match/Makefile

-35
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// An extended version of the ui/changing-crates.rs test, this test puts
2+
// multiple mismatching crates into the search path of crateC (A2 and A3)
3+
// and checks that the standard error contains helpful messages to indicate
4+
// what should be done to fix the issue.
5+
// See https://github.com/rust-lang/rust/issues/13266
6+
7+
use run_make_support::{fs_wrapper, rustc};
8+
9+
fn main() {
10+
fs_wrapper::create_dir("a1");
11+
fs_wrapper::create_dir("a2");
12+
fs_wrapper::create_dir("a3");
13+
rustc().crate_type("rlib").out_dir("a1").input("crateA1.rs").run();
14+
rustc().crate_type("rlib").library_search_path("a1").input("crateB.rs").run();
15+
rustc().crate_type("rlib").out_dir("a2").input("crateA2.rs").run();
16+
rustc().crate_type("rlib").out_dir("a3").input("crateA3.rs").run();
17+
// Ensure crateC fails to compile since A1 is "missing" and A2/A3 hashes do not match
18+
rustc()
19+
.crate_type("rlib")
20+
.library_search_path("a2")
21+
.library_search_path("a3")
22+
.input("crateC.rs")
23+
.run_fail()
24+
.assert_stderr_contains(
25+
"found possibly newer version of crate `crateA` which `crateB` depends on",
26+
)
27+
.assert_stderr_contains("note: perhaps that crate needs to be recompiled?")
28+
.assert_stderr_contains("crate `crateA`:")
29+
.assert_stderr_contains("crate `crateB`:");
30+
// the 'crate `crateA`' will match two entries.
31+
}

tests/run-make/overwrite-input/Makefile

-7
This file was deleted.
+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
warning: ignoring --out-dir flag due to -o flag
2-
31
error: the input file "main.rs" would be overwritten by the generated executable
42

5-
error: aborting due to 1 previous error; 1 warning emitted
3+
error: aborting due to 1 previous error
64

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
warning: ignoring --out-dir flag due to -o flag
2-
31
error: the generated executable for the input file "main.rs" conflicts with the existing directory "."
42

5-
error: aborting due to 1 previous error; 1 warning emitted
3+
error: aborting due to 1 previous error
64

tests/run-make/overwrite-input/main.stderr

-6
This file was deleted.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// An attempt to set the output `-o` into a directory or a file we cannot write into should indeed
2+
// be an error; but not an ICE (Internal Compiler Error). This test attempts both and checks
3+
// that the standard error matches what is expected.
4+
// See https://github.com/rust-lang/rust/issues/66530
5+
6+
use run_make_support::{diff, rustc};
7+
8+
fn main() {
9+
let file_out = rustc().input("main.rs").output("main.rs").run_fail().stderr_utf8();
10+
let folder_out = rustc().input("main.rs").output(".").run_fail().stderr_utf8();
11+
diff().expected_file("file.stderr").actual_text("actual-file-stderr", file_out).run();
12+
diff().expected_file("folder.stderr").actual_text("actual-folder-stderr", folder_out).run();
13+
}

tests/run-make/use-suggestions-rust-2018/Makefile

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// The compilation error caused by calling on an unimported crate
2+
// should have a suggestion to write, say, crate::bar::Foo instead
3+
// of just bar::Foo. However, this suggestion used to only appear for
4+
// extern crate statements, not crate struct. After this was fixed in #51456,
5+
// this test checks that the correct suggestion is printed no matter what.
6+
// See https://github.com/rust-lang/rust/issues/51212
7+
8+
use run_make_support::{rust_lib_name, rustc};
9+
10+
fn main() {
11+
rustc().input("ep-nested-lib.rs").run();
12+
rustc()
13+
.input("use-suggestions.rs")
14+
.edition("2018")
15+
.extern_("ep_nested_lib", rust_lib_name("ep_nested_lib"))
16+
.run_fail()
17+
.assert_stderr_contains("use ep_nested_lib::foo::bar::Baz");
18+
}

0 commit comments

Comments
 (0)