@@ -2,13 +2,13 @@ use std::fs;
2
2
use std:: path:: { Path , PathBuf } ;
3
3
use std:: process:: Command ;
4
4
5
- use super :: path:: { Dirs , RelPath } ;
6
- use super :: rustc_info:: get_file_name;
7
- use super :: utils:: {
5
+ use crate :: path:: { Dirs , RelPath } ;
6
+ use crate :: rustc_info:: get_file_name;
7
+ use crate :: utils:: {
8
8
maybe_incremental, remove_dir_if_exists, spawn_and_wait, try_hard_link, CargoProject , Compiler ,
9
9
LogGroup ,
10
10
} ;
11
- use super :: { CodegenBackend , SysrootKind } ;
11
+ use crate :: { config , CodegenBackend , SysrootKind } ;
12
12
13
13
static DIST_DIR : RelPath = RelPath :: DIST ;
14
14
static BIN_DIR : RelPath = RelPath :: DIST . join ( "bin" ) ;
@@ -128,8 +128,8 @@ pub(crate) fn build_sysroot(
128
128
cargo : bootstrap_host_compiler. cargo . clone ( ) ,
129
129
rustc : rustc_clif. clone ( ) ,
130
130
rustdoc : rustdoc_clif. clone ( ) ,
131
- rustflags : String :: new ( ) ,
132
- rustdocflags : String :: new ( ) ,
131
+ rustflags : vec ! [ ] ,
132
+ rustdocflags : vec ! [ ] ,
133
133
triple : target_triple,
134
134
runner : vec ! [ ] ,
135
135
}
@@ -185,7 +185,7 @@ fn build_sysroot_for_triple(
185
185
186
186
#[ must_use]
187
187
fn build_llvm_sysroot_for_triple ( compiler : Compiler ) -> SysrootTarget {
188
- let default_sysroot = super :: rustc_info:: get_default_sysroot ( & compiler. rustc ) ;
188
+ let default_sysroot = crate :: rustc_info:: get_default_sysroot ( & compiler. rustc ) ;
189
189
190
190
let mut target_libs = SysrootTarget { triple : compiler. triple , libs : vec ! [ ] } ;
191
191
@@ -234,32 +234,32 @@ fn build_clif_sysroot_for_triple(
234
234
235
235
let build_dir = STANDARD_LIBRARY . target_dir ( dirs) . join ( & compiler. triple ) . join ( channel) ;
236
236
237
- if !super :: config:: get_bool ( "keep_sysroot" ) {
237
+ if !config:: get_bool ( "keep_sysroot" ) {
238
238
// Cleanup the deps dir, but keep build scripts and the incremental cache for faster
239
239
// recompilation as they are not affected by changes in cg_clif.
240
240
remove_dir_if_exists ( & build_dir. join ( "deps" ) ) ;
241
241
}
242
242
243
243
// Build sysroot
244
- let mut rustflags = " -Zforce-unstable-if-unmarked -Cpanic=abort". to_string ( ) ;
244
+ let mut rustflags = vec ! [ " -Zforce-unstable-if-unmarked" . to_owned ( ) , " -Cpanic=abort". to_owned ( ) ] ;
245
245
match cg_clif_dylib_path {
246
246
CodegenBackend :: Local ( path) => {
247
- rustflags. push_str ( & format ! ( " -Zcodegen-backend={}" , path. to_str( ) . unwrap( ) ) ) ;
247
+ rustflags. push ( format ! ( "-Zcodegen-backend={}" , path. to_str( ) . unwrap( ) ) ) ;
248
248
}
249
249
CodegenBackend :: Builtin ( name) => {
250
- rustflags. push_str ( & format ! ( " -Zcodegen-backend={name}" ) ) ;
250
+ rustflags. push ( format ! ( "-Zcodegen-backend={name}" ) ) ;
251
251
}
252
252
} ;
253
253
// Necessary for MinGW to find rsbegin.o and rsend.o
254
- rustflags
255
- . push_str ( & format ! ( " --sysroot {}" , RTSTARTUP_SYSROOT . to_path( dirs) . to_str( ) . unwrap( ) ) ) ;
254
+ rustflags. push ( "--sysroot" . to_owned ( ) ) ;
255
+ rustflags . push ( RTSTARTUP_SYSROOT . to_path ( dirs) . to_str ( ) . unwrap ( ) . to_owned ( ) ) ;
256
256
if channel == "release" {
257
257
// Incremental compilation by default disables mir inlining. This leads to both a decent
258
258
// compile perf and a significant runtime perf regression. As such forcefully enable mir
259
259
// inlining.
260
- rustflags. push_str ( " -Zinline-mir") ;
260
+ rustflags. push ( " -Zinline-mir". to_owned ( ) ) ;
261
261
}
262
- compiler. rustflags += & rustflags;
262
+ compiler. rustflags . extend ( rustflags) ;
263
263
let mut build_cmd = STANDARD_LIBRARY . build ( & compiler, dirs) ;
264
264
maybe_incremental ( & mut build_cmd) ;
265
265
if channel == "release" {
@@ -289,8 +289,8 @@ fn build_clif_sysroot_for_triple(
289
289
}
290
290
291
291
fn build_rtstartup ( dirs : & Dirs , compiler : & Compiler ) -> Option < SysrootTarget > {
292
- if !super :: config:: get_bool ( "keep_sysroot" ) {
293
- super :: prepare:: prepare_stdlib ( dirs, & compiler. rustc ) ;
292
+ if !config:: get_bool ( "keep_sysroot" ) {
293
+ crate :: prepare:: prepare_stdlib ( dirs, & compiler. rustc ) ;
294
294
}
295
295
296
296
if !compiler. triple . ends_with ( "windows-gnu" ) {
@@ -306,6 +306,7 @@ fn build_rtstartup(dirs: &Dirs, compiler: &Compiler) -> Option<SysrootTarget> {
306
306
let obj = RTSTARTUP_SYSROOT . to_path ( dirs) . join ( format ! ( "{file}.o" ) ) ;
307
307
let mut build_rtstartup_cmd = Command :: new ( & compiler. rustc ) ;
308
308
build_rtstartup_cmd
309
+ . arg ( "-Ainternal_features" ) // Missing #[allow(internal_features)]
309
310
. arg ( "--target" )
310
311
. arg ( & compiler. triple )
311
312
. arg ( "--emit=obj" )
0 commit comments