mirror of
https://github.com/rust-lang/cargo
synced 2024-10-13 19:22:33 +00:00
test(lints): Verify precedence with profile.rustflags
This commit is contained in:
parent
1dfa101cd1
commit
e82fe885b5
|
@ -434,6 +434,42 @@ pub fn foo(num: i32) -> u32 {
|
|||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn profile_rustflags_doesnt_have_precedence() {
|
||||
let foo = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
cargo-features = ["lints", "profile-rustflags"]
|
||||
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
|
||||
[lints.rust]
|
||||
"unsafe_code" = "allow"
|
||||
|
||||
[profile.dev]
|
||||
rustflags = ["-D", "unsafe_code"]
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"src/lib.rs",
|
||||
"
|
||||
pub fn foo(num: i32) -> u32 {
|
||||
unsafe { std::mem::transmute(num) }
|
||||
}
|
||||
",
|
||||
)
|
||||
.build();
|
||||
|
||||
foo.cargo("check")
|
||||
.arg("-v")
|
||||
.masquerade_as_nightly_cargo(&["lints", "profile-rustflags"])
|
||||
.with_status(0)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn without_priority() {
|
||||
Package::new("reg-dep", "1.0.0").publish();
|
||||
|
|
Loading…
Reference in a new issue