File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,42 @@ pub fn foo(num: i32) -> u32 {
439439 . run ( ) ;
440440}
441441
442+ #[ cargo_test]
443+ fn profile_rustflags_doesnt_have_precedence ( ) {
444+ let foo = project ( )
445+ . file (
446+ "Cargo.toml" ,
447+ r#"
448+ cargo-features = ["lints", "profile-rustflags"]
449+
450+ [package]
451+ name = "foo"
452+ version = "0.0.1"
453+
454+ [lints.rust]
455+ "unsafe_code" = "allow"
456+
457+ [profile.dev]
458+ rustflags = ["-D", "unsafe_code"]
459+ "# ,
460+ )
461+ . file (
462+ "src/lib.rs" ,
463+ "
464+ pub fn foo(num: i32) -> u32 {
465+ unsafe { std::mem::transmute(num) }
466+ }
467+ " ,
468+ )
469+ . build ( ) ;
470+
471+ foo. cargo ( "check" )
472+ . arg ( "-v" )
473+ . masquerade_as_nightly_cargo ( & [ "lints" , "profile-rustflags" ] )
474+ . with_status ( 0 )
475+ . run ( ) ;
476+ }
477+
442478#[ cargo_test]
443479fn without_priority ( ) {
444480 Package :: new ( "reg-dep" , "1.0.0" ) . publish ( ) ;
You can’t perform that action at this time.
0 commit comments