rust/tests/run-make/crate-name-priority/rmake.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
728 B
Rust
Raw Normal View History

2024-06-19 15:52:36 -05:00
// The `crate_name` rustc flag should have higher priority
// over `#![crate_name = "foo"]` defined inside the source code.
// This test has a conflict between crate_names defined in the .rs files
// and the compiler flags, and checks that the flag is favoured each time.
// See https://github.com/rust-lang/rust/pull/15518
2024-07-17 08:31:38 -05:00
use run_make_support::{bin_name, rfs, rustc};
2024-06-19 15:52:36 -05:00
fn main() {
rustc().input("foo.rs").run();
rfs::remove_file(bin_name("foo"));
2024-06-19 15:52:36 -05:00
rustc().input("foo.rs").crate_name("bar").run();
rfs::remove_file(bin_name("bar"));
2024-06-19 15:52:36 -05:00
rustc().input("foo1.rs").run();
rfs::remove_file(bin_name("foo"));
2024-06-19 15:52:36 -05:00
rustc().input("foo1.rs").output(bin_name("bar1")).run();
rfs::remove_file(bin_name("bar1"));
2024-06-19 15:52:36 -05:00
}