File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 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> {
866866 cargo. arg ( "-Zunstable-options" ) ;
867867 // Explicitly does *not* set `--cfg=bootstrap`, since we're using a nightly clippy.
868868 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| {
870870 if output. status . success ( )
871- && t ! ( std:: str :: from_utf8( & output. stdout) ) . contains ( "nightly" )
872871 {
873872 Ok ( output)
874873 } else {
875874 Err ( ( ) )
876875 }
877- } ) {
876+ } ) . unwrap_or_else ( |_| {
878877 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"
880879 ) ;
881- eprintln ! ( "help: try `rustup default nightly `" ) ;
880+ eprintln ! ( "help: try `rustup component add clippy `" ) ;
882881 std:: process:: exit ( 1 ) ;
882+ } ) ;
883+ if !t ! ( std:: str :: from_utf8( & output. stdout) ) . contains ( "nightly" ) {
884+ rustflags. arg ( "--cfg=bootstrap" ) ;
883885 }
884886 } else {
885887 rustflags. arg ( "--cfg=bootstrap" ) ;
You can’t perform that action at this time.
0 commit comments