File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 11use std:: env;
22use std:: ffi:: OsString ;
33use std:: path:: Path ;
4- use std:: process:: { self , Command , ExitStatus , Stdio } ;
4+ use std:: process:: { self , Command , Stdio } ;
55
66fn main ( ) {
77 println ! ( "cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP" ) ;
88
9- match compile_probe ( ) {
10- Some ( status) if status. success ( ) => println ! ( "cargo:rustc-cfg=error_generic_member_access" ) ,
11- _ => { }
9+ if compile_probe ( ) {
10+ println ! ( "cargo:rustc-cfg=error_generic_member_access" ) ;
1211 }
1312}
1413
15- fn compile_probe ( ) -> Option < ExitStatus > {
14+ fn compile_probe ( ) -> bool {
1615 if env:: var_os ( "RUSTC_STAGE" ) . is_some ( ) {
1716 // We are running inside rustc bootstrap. This is a highly non-standard
1817 // environment with issues such as:
@@ -21,7 +20,7 @@ fn compile_probe() -> Option<ExitStatus> {
2120 // https://github.com/rust-lang/rust/issues/114839
2221 //
2322 // Let's just not use nightly features here.
24- return None ;
23+ return false ;
2524 }
2625
2726 let rustc = cargo_env_var ( "RUSTC" ) ;
@@ -60,7 +59,10 @@ fn compile_probe() -> Option<ExitStatus> {
6059 }
6160 }
6261
63- cmd. status ( ) . ok ( )
62+ match cmd. status ( ) {
63+ Ok ( status) => status. success ( ) ,
64+ Err ( _) => false ,
65+ }
6466}
6567
6668fn cargo_env_var ( key : & str ) -> OsString {
You can’t perform that action at this time.
0 commit comments