@@ -709,6 +709,7 @@ fn gen_pkg_and_compile(input: &Input, action: &InputAction) -> Result<()> {
709
709
"build" ,
710
710
& * mani_path. to_string_lossy ( ) ,
711
711
action. use_bincache ,
712
+ action. use_nightly ,
712
713
& meta,
713
714
) ?;
714
715
@@ -735,6 +736,7 @@ fn gen_pkg_and_compile(input: &Input, action: &InputAction) -> Result<()> {
735
736
pkg_path,
736
737
& * mani_path. to_string_lossy ( ) ,
737
738
action. use_bincache ,
739
+ action. use_nightly ,
738
740
& meta,
739
741
) ?;
740
742
@@ -794,6 +796,8 @@ struct InputAction {
794
796
/// Use shared binary cache?
795
797
use_bincache : bool ,
796
798
799
+ use_nightly : bool ,
800
+
797
801
/// The package metadata structure for the current invocation.
798
802
metadata : PackageMetadata ,
799
803
@@ -820,6 +824,7 @@ impl InputAction {
820
824
cmd,
821
825
& * self . manifest_path ( ) . to_string_lossy ( ) ,
822
826
self . use_bincache ,
827
+ self . use_nightly ,
823
828
& self . metadata ,
824
829
)
825
830
}
@@ -941,6 +946,7 @@ fn decide_action_for(
941
946
pkg_path,
942
947
using_cache,
943
948
use_bincache : args. use_bincache . unwrap_or ( using_cache) ,
949
+ use_nightly : matches ! ( args. build_kind, BuildKind :: Bench ) ,
944
950
metadata : input_meta,
945
951
old_metadata : None ,
946
952
manifest : mani_str,
@@ -1359,9 +1365,13 @@ fn cargo(
1359
1365
cmd_name : & str ,
1360
1366
manifest : & str ,
1361
1367
use_bincache : bool ,
1368
+ nightly : bool ,
1362
1369
meta : & PackageMetadata ,
1363
1370
) -> Result < Command > {
1364
1371
let mut cmd = Command :: new ( "cargo" ) ;
1372
+ if nightly {
1373
+ cmd. arg ( "+nightly" ) ;
1374
+ }
1365
1375
cmd. arg ( cmd_name) . arg ( "--manifest-path" ) . arg ( manifest) ;
1366
1376
1367
1377
if platform:: force_cargo_color ( ) {
@@ -1399,6 +1409,7 @@ fn cargo_target<P>(
1399
1409
pkg_path : P ,
1400
1410
manifest : & str ,
1401
1411
use_bincache : bool ,
1412
+ use_nightly : bool ,
1402
1413
meta : & PackageMetadata ,
1403
1414
) -> Result < PathBuf >
1404
1415
where
@@ -1411,7 +1422,7 @@ where
1411
1422
use_bincache
1412
1423
) ;
1413
1424
1414
- let exe_path = cargo_target_by_message ( input, manifest, use_bincache, meta) ?;
1425
+ let exe_path = cargo_target_by_message ( input, manifest, use_bincache, use_nightly , meta) ?;
1415
1426
1416
1427
trace ! ( ".. exe_path: {:?}" , exe_path) ;
1417
1428
@@ -1435,6 +1446,7 @@ fn cargo_target_by_message(
1435
1446
input : & Input ,
1436
1447
manifest : & str ,
1437
1448
use_bincache : bool ,
1449
+ use_nightly : bool ,
1438
1450
meta : & PackageMetadata ,
1439
1451
) -> Result < PathBuf > {
1440
1452
use std:: io:: { BufRead , BufReader } ;
@@ -1445,7 +1457,7 @@ fn cargo_target_by_message(
1445
1457
use_bincache
1446
1458
) ;
1447
1459
1448
- let mut cmd = cargo ( "build" , manifest, use_bincache, meta) ?;
1460
+ let mut cmd = cargo ( "build" , manifest, use_bincache, use_nightly , meta) ?;
1449
1461
cmd. arg ( "--message-format=json" ) ;
1450
1462
cmd. stdout ( process:: Stdio :: piped ( ) ) ;
1451
1463
cmd. stderr ( process:: Stdio :: null ( ) ) ;
0 commit comments