@@ -595,6 +595,7 @@ macro_rules! tool_extended {
595595 $toolstate: ident,
596596 $path: expr,
597597 $tool_name: expr,
598+ stable = $stable: expr,
598599 $extra_deps: block; ) +) => {
599600 $(
600601 #[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
@@ -606,17 +607,22 @@ macro_rules! tool_extended {
606607
607608 impl Step for $name {
608609 type Output = Option <PathBuf >;
609- const DEFAULT : bool = true ;
610+ const DEFAULT : bool = true ; // Overwritten below
610611 const ONLY_HOSTS : bool = true ;
611612
612613 fn should_run( run: ShouldRun <' _>) -> ShouldRun <' _> {
613614 let builder = run. builder;
614615 run. path( $path) . default_condition(
615616 builder. config. extended
616- && builder. config. tools. as_ref( ) . map_or( true , |tools| {
617- tools. iter( ) . any( |tool| match tool. as_ref( ) {
618- "clippy" => $tool_name == "clippy-driver" ,
619- x => $tool_name == x,
617+ && builder. config. tools. as_ref( ) . map_or(
618+ // By default, on nightly/dev enable all tools, else only
619+ // build stable tools.
620+ $stable || builder. build. unstable_features( ) ,
621+ // If `tools` is set, search list for this tool.
622+ |tools| {
623+ tools. iter( ) . any( |tool| match tool. as_ref( ) {
624+ "clippy" => $tool_name == "clippy-driver" ,
625+ x => $tool_name == x,
620626 } )
621627 } ) ,
622628 )
@@ -652,20 +658,20 @@ macro_rules! tool_extended {
652658// Note: tools need to be also added to `Builder::get_step_descriptions` in `build.rs`
653659// to make `./x.py build <tool>` work.
654660tool_extended ! ( ( self , builder) ,
655- Cargofmt , rustfmt, "src/tools/rustfmt" , "cargo-fmt" , { } ;
656- CargoClippy , clippy, "src/tools/clippy" , "cargo-clippy" , { } ;
657- Clippy , clippy, "src/tools/clippy" , "clippy-driver" , { } ;
658- Miri , miri, "src/tools/miri" , "miri" , { } ;
659- CargoMiri , miri, "src/tools/miri/cargo-miri" , "cargo-miri" , { } ;
660- Rls , rls, "src/tools/rls" , "rls" , {
661+ Cargofmt , rustfmt, "src/tools/rustfmt" , "cargo-fmt" , stable= true , { } ;
662+ CargoClippy , clippy, "src/tools/clippy" , "cargo-clippy" , stable= true , { } ;
663+ Clippy , clippy, "src/tools/clippy" , "clippy-driver" , stable= true , { } ;
664+ Miri , miri, "src/tools/miri" , "miri" , stable= false , { } ;
665+ CargoMiri , miri, "src/tools/miri/cargo-miri" , "cargo-miri" , stable= false , { } ;
666+ Rls , rls, "src/tools/rls" , "rls" , stable= true , {
661667 builder. ensure( Clippy {
662668 compiler: self . compiler,
663669 target: self . target,
664670 extra_features: Vec :: new( ) ,
665671 } ) ;
666672 self . extra_features. push( "clippy" . to_owned( ) ) ;
667673 } ;
668- Rustfmt , rustfmt, "src/tools/rustfmt" , "rustfmt" , { } ;
674+ Rustfmt , rustfmt, "src/tools/rustfmt" , "rustfmt" , stable= true , { } ;
669675) ;
670676
671677impl < ' a > Builder < ' a > {
0 commit comments