@@ -595,6 +595,7 @@ macro_rules! tool_extended {
595
595
$toolstate: ident,
596
596
$path: expr,
597
597
$tool_name: expr,
598
+ stable = $stable: expr,
598
599
$extra_deps: block; ) +) => {
599
600
$(
600
601
#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
@@ -606,17 +607,22 @@ macro_rules! tool_extended {
606
607
607
608
impl Step for $name {
608
609
type Output = Option <PathBuf >;
609
- const DEFAULT : bool = true ;
610
+ const DEFAULT : bool = true ; // Overwritten below
610
611
const ONLY_HOSTS : bool = true ;
611
612
612
613
fn should_run( run: ShouldRun <' _>) -> ShouldRun <' _> {
613
614
let builder = run. builder;
614
615
run. path( $path) . default_condition(
615
616
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,
620
626
} )
621
627
} ) ,
622
628
)
@@ -652,20 +658,20 @@ macro_rules! tool_extended {
652
658
// Note: tools need to be also added to `Builder::get_step_descriptions` in `build.rs`
653
659
// to make `./x.py build <tool>` work.
654
660
tool_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 , {
661
667
builder. ensure( Clippy {
662
668
compiler: self . compiler,
663
669
target: self . target,
664
670
extra_features: Vec :: new( ) ,
665
671
} ) ;
666
672
self . extra_features. push( "clippy" . to_owned( ) ) ;
667
673
} ;
668
- Rustfmt , rustfmt, "src/tools/rustfmt" , "rustfmt" , { } ;
674
+ Rustfmt , rustfmt, "src/tools/rustfmt" , "rustfmt" , stable= true , { } ;
669
675
) ;
670
676
671
677
impl < ' a > Builder < ' a > {
0 commit comments