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 @@ -434,6 +434,42 @@ pub fn foo(num: i32) -> u32 {
434434 . run ( ) ;
435435}
436436
437+ #[ cargo_test]
438+ fn profile_rustflags_doesnt_have_precedence ( ) {
439+ let foo = project ( )
440+ . file (
441+ "Cargo.toml" ,
442+ r#"
443+ cargo-features = ["lints", "profile-rustflags"]
444+
445+ [package]
446+ name = "foo"
447+ version = "0.0.1"
448+
449+ [lints.rust]
450+ "unsafe_code" = "allow"
451+
452+ [profile.dev]
453+ rustflags = ["-D", "unsafe_code"]
454+ "# ,
455+ )
456+ . file (
457+ "src/lib.rs" ,
458+ "
459+ pub fn foo(num: i32) -> u32 {
460+ unsafe { std::mem::transmute(num) }
461+ }
462+ " ,
463+ )
464+ . build ( ) ;
465+
466+ foo. cargo ( "check" )
467+ . arg ( "-v" )
468+ . masquerade_as_nightly_cargo ( & [ "lints" , "profile-rustflags" ] )
469+ . with_status ( 0 )
470+ . run ( ) ;
471+ }
472+
437473#[ cargo_test]
438474fn without_priority ( ) {
439475 Package :: new ( "reg-dep" , "1.0.0" ) . publish ( ) ;
You can’t perform that action at this time.
0 commit comments