@@ -36,8 +36,9 @@ fn main() {
36
36
let args = env:: args_os ( ) . skip ( 1 ) . collect :: < Vec < _ > > ( ) ;
37
37
// Detect whether or not we're a build script depending on whether --target
38
38
// is passed (a bit janky...)
39
- let target = args. windows ( 2 ) . find ( |w| & * w[ 0 ] == "--target" )
40
- . and_then ( |w| w[ 1 ] . to_str ( ) ) ;
39
+ let target = args. windows ( 2 )
40
+ . find ( |w| & * w[ 0 ] == "--target" )
41
+ . and_then ( |w| w[ 1 ] . to_str ( ) ) ;
41
42
let version = args. iter ( ) . find ( |w| & * * w == "-vV" ) ;
42
43
43
44
// Build scripts always use the snapshot compiler which is guaranteed to be
@@ -64,9 +65,10 @@ fn main() {
64
65
65
66
let mut cmd = Command :: new ( rustc) ;
66
67
cmd. args ( & args)
67
- . arg ( "--cfg" ) . arg ( format ! ( "stage{}" , stage) )
68
- . env ( bootstrap:: util:: dylib_path_var ( ) ,
69
- env:: join_paths ( & dylib_path) . unwrap ( ) ) ;
68
+ . arg ( "--cfg" )
69
+ . arg ( format ! ( "stage{}" , stage) )
70
+ . env ( bootstrap:: util:: dylib_path_var ( ) ,
71
+ env:: join_paths ( & dylib_path) . unwrap ( ) ) ;
70
72
71
73
if let Some ( target) = target {
72
74
// The stage0 compiler has a special sysroot distinct from what we
@@ -101,9 +103,8 @@ fn main() {
101
103
// This... is a bit of a hack how we detect this. Ideally this
102
104
// information should be encoded in the crate I guess? Would likely
103
105
// require an RFC amendment to RFC 1513, however.
104
- let is_panic_abort = args. windows ( 2 ) . any ( |a| {
105
- & * a[ 0 ] == "--crate-name" && & * a[ 1 ] == "panic_abort"
106
- } ) ;
106
+ let is_panic_abort = args. windows ( 2 )
107
+ . any ( |a| & * a[ 0 ] == "--crate-name" && & * a[ 1 ] == "panic_abort" ) ;
107
108
if is_panic_abort {
108
109
cmd. arg ( "-C" ) . arg ( "panic=abort" ) ;
109
110
}
@@ -116,7 +117,7 @@ fn main() {
116
117
cmd. arg ( "-Cdebuginfo=1" ) ;
117
118
}
118
119
let debug_assertions = match env:: var ( "RUSTC_DEBUG_ASSERTIONS" ) {
119
- Ok ( s) => if s == "true" { "y" } else { "n" } ,
120
+ Ok ( s) => if s == "true" { "y" } else { "n" } ,
120
121
Err ( ..) => "n" ,
121
122
} ;
122
123
cmd. arg ( "-C" ) . arg ( format ! ( "debug-assertions={}" , debug_assertions) ) ;
0 commit comments