Skip to content

Commit d37910a

Browse files
committed
rewrite crate-name-priority to rmake
1 parent f22b5af commit d37910a

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ run-make/compiler-lookup-paths/Makefile
1616
run-make/compiler-rt-works-on-mingw/Makefile
1717
run-make/compressed-debuginfo/Makefile
1818
run-make/crate-hash-rustc-version/Makefile
19-
run-make/crate-name-priority/Makefile
2019
run-make/cross-lang-lto-clang/Makefile
2120
run-make/cross-lang-lto-pgo-smoketest/Makefile
2221
run-make/cross-lang-lto-upstream-rlibs/Makefile

tests/run-make/crate-name-priority/Makefile

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// The `crate_name` rustc flag should have higher priority
2+
// over `#![crate_name = "foo"]` defined inside the source code.
3+
// This test has a conflict between crate_names defined in the .rs files
4+
// and the compiler flags, and checks that the flag is favoured each time.
5+
// See https://github.com/rust-lang/rust/pull/15518
6+
7+
use run_make_support::{bin_name, fs_wrapper, rustc};
8+
9+
fn main() {
10+
rustc().input("foo.rs").run();
11+
fs_wrapper::remove_file(bin_name("foo"));
12+
rustc().input("foo.rs").crate_name("bar").run();
13+
fs_wrapper::remove_file(bin_name("bar"));
14+
rustc().input("foo1.rs").run();
15+
fs_wrapper::remove_file(bin_name("foo"));
16+
rustc().input("foo1.rs").output(bin_name("bar1")).run();
17+
fs_wrapper::remove_file(bin_name("bar1"));
18+
}

0 commit comments

Comments
 (0)