File tree 2 files changed +30
-1
lines changed
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -363,7 +363,7 @@ pub trait ArgMatchesExt {
363
363
// This is an early exit, since it allows combination with `--release`.
364
364
match ( specified_profile, profile_checking) {
365
365
// `cargo rustc` has legacy handling of these names
366
- ( Some ( name @ ( "test" | "bench" | "check" ) ) , ProfileChecking :: LegacyRustc ) |
366
+ ( Some ( name @ ( "dev" | " test" | "bench" | "check" ) ) , ProfileChecking :: LegacyRustc ) |
367
367
// `cargo fix` and `cargo check` has legacy handling of this profile name
368
368
( Some ( name @ "test" ) , ProfileChecking :: LegacyTestOnly ) => return Ok ( InternedString :: new ( name) ) ,
369
369
_ => { }
Original file line number Diff line number Diff line change @@ -702,3 +702,32 @@ fn legacy_commands_support_custom() {
702
702
p. build_dir ( ) . rm_rf ( ) ;
703
703
}
704
704
}
705
+
706
+ #[ cargo_test]
707
+ fn legacy_rustc ( ) {
708
+ // `cargo rustc` historically has supported dev/test/bench/check
709
+ // other profiles are covered in check::rustc_check
710
+ let p = project ( )
711
+ . file (
712
+ "Cargo.toml" ,
713
+ r#"
714
+ [package]
715
+ name = "foo"
716
+ version = "0.1.0"
717
+
718
+ [profile.dev]
719
+ codegen-units = 3
720
+ "# ,
721
+ )
722
+ . file ( "src/lib.rs" , "" )
723
+ . build ( ) ;
724
+ p. cargo ( "rustc --profile dev -v" )
725
+ . with_stderr (
726
+ "\
727
+ [COMPILING] foo v0.1.0 [..]
728
+ [RUNNING] `rustc --crate-name foo [..]-C codegen-units=3[..]
729
+ [FINISHED] [..]
730
+ " ,
731
+ )
732
+ . run ( ) ;
733
+ }
You can’t perform that action at this time.
0 commit comments