File tree 2 files changed +20
-6
lines changed
2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -320,14 +320,22 @@ pub trait ArgMatchesExt {
320
320
}
321
321
322
322
if self . _is_present ( "release" ) {
323
- match specified_profile {
324
- None | Some ( ProfileKind :: Release ) => Ok ( ProfileKind :: Release ) ,
325
- _ => failure:: bail!( "Conflicting usage of --profile and --release" ) ,
323
+ if !config. cli_unstable ( ) . unstable_options {
324
+ Ok ( ProfileKind :: Release )
325
+ } else {
326
+ match specified_profile {
327
+ None | Some ( ProfileKind :: Release ) => Ok ( ProfileKind :: Release ) ,
328
+ _ => failure:: bail!( "Conflicting usage of --profile and --release" ) ,
329
+ }
326
330
}
327
331
} else if self . _is_present ( "debug" ) {
328
- match specified_profile {
329
- None | Some ( ProfileKind :: Dev ) => Ok ( ProfileKind :: Dev ) ,
330
- _ => failure:: bail!( "Conflicting usage of --profile and --debug" ) ,
332
+ if !config. cli_unstable ( ) . unstable_options {
333
+ Ok ( ProfileKind :: Dev )
334
+ } else {
335
+ match specified_profile {
336
+ None | Some ( ProfileKind :: Dev ) => Ok ( ProfileKind :: Dev ) ,
337
+ _ => failure:: bail!( "Conflicting usage of --profile and --debug" ) ,
338
+ }
331
339
}
332
340
} else {
333
341
Ok ( specified_profile. unwrap_or ( default) )
Original file line number Diff line number Diff line change @@ -335,6 +335,12 @@ fn rustc_check() {
335
335
. build ( ) ;
336
336
337
337
foo. cargo ( "rustc --profile check -- --emit=metadata" ) . run ( ) ;
338
+
339
+ // Verify compatible usage of --profile with --release, issue #7488
340
+ foo. cargo ( "rustc --profile check --release -- --emit=metadata" )
341
+ . run ( ) ;
342
+ foo. cargo ( "rustc --profile test --release -- --emit=metadata" )
343
+ . run ( ) ;
338
344
}
339
345
340
346
#[ cargo_test]
You can’t perform that action at this time.
0 commit comments