File tree 3 files changed +6
-4
lines changed
3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -442,6 +442,8 @@ impl<'a> ShouldRun<'a> {
442
442
/// Indicates it should run if the command-line selects any of the given crates.
443
443
///
444
444
/// `make_run` will be called a single time with all matching command-line paths.
445
+ ///
446
+ /// Prefer [`ShouldRun::crate_or_deps`] to this function where possible.
445
447
pub ( crate ) fn crates ( mut self , crates : Vec < & Crate > ) -> Self {
446
448
for krate in crates {
447
449
let path = krate. local_path ( self . builder ) ;
Original file line number Diff line number Diff line change @@ -85,8 +85,7 @@ impl Step for Std {
85
85
const DEFAULT : bool = true ;
86
86
87
87
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
88
- let crates = run. builder . in_tree_crates ( "sysroot" , None ) ;
89
- run. crates ( crates) . path ( "library" )
88
+ run. crate_or_deps ( "sysroot" ) . path ( "library" )
90
89
}
91
90
92
91
fn make_run ( run : RunConfig < ' _ > ) {
@@ -215,8 +214,7 @@ impl Step for Rustc {
215
214
const DEFAULT : bool = true ;
216
215
217
216
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
218
- let crates = run. builder . in_tree_crates ( "rustc-main" , None ) ;
219
- run. crates ( crates) . path ( "compiler" )
217
+ run. crate_or_deps ( "rustc-main" ) . path ( "compiler" )
220
218
}
221
219
222
220
fn make_run ( run : RunConfig < ' _ > ) {
Original file line number Diff line number Diff line change @@ -620,6 +620,8 @@ impl Step for Rustc {
620
620
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
621
621
let mut crates = run. builder . in_tree_crates ( "rustc-main" , None ) ;
622
622
for ( i, krate) in crates. iter ( ) . enumerate ( ) {
623
+ // We can't allow `build rustc` as an alias for this Step, because that's reserved by `Assemble`.
624
+ // Ideally Assemble would use `build compiler` instead, but that seems too confusing to be worth the breaking change.
623
625
if krate. name == "rustc-main" {
624
626
crates. swap_remove ( i) ;
625
627
break ;
You can’t perform that action at this time.
0 commit comments