File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -866,20 +866,22 @@ impl<'a> Builder<'a> {
866
866
cargo. arg ( "-Zunstable-options" ) ;
867
867
// Explicitly does *not* set `--cfg=bootstrap`, since we're using a nightly clippy.
868
868
let host_version = Command :: new ( "rustc" ) . arg ( "--version" ) . output ( ) . map_err ( |_| ( ) ) ;
869
- if let Err ( _ ) = host_version. and_then ( |output| {
869
+ let output = host_version. and_then ( |output| {
870
870
if output. status . success ( )
871
- && t ! ( std:: str :: from_utf8( & output. stdout) ) . contains ( "nightly" )
872
871
{
873
872
Ok ( output)
874
873
} else {
875
874
Err ( ( ) )
876
875
}
877
- } ) {
876
+ } ) . unwrap_or_else ( |_| {
878
877
eprintln ! (
879
- "error: `x.py clippy` requires a nightly host `rustc` toolchain with the `clippy` component"
878
+ "error: `x.py clippy` requires a host `rustc` toolchain with the `clippy` component"
880
879
) ;
881
- eprintln ! ( "help: try `rustup default nightly `" ) ;
880
+ eprintln ! ( "help: try `rustup component add clippy `" ) ;
882
881
std:: process:: exit ( 1 ) ;
882
+ } ) ;
883
+ if !t ! ( std:: str :: from_utf8( & output. stdout) ) . contains ( "nightly" ) {
884
+ rustflags. arg ( "--cfg=bootstrap" ) ;
883
885
}
884
886
} else {
885
887
rustflags. arg ( "--cfg=bootstrap" ) ;
You can’t perform that action at this time.
0 commit comments