@@ -2,13 +2,13 @@ use std::fs;
22use std:: path:: { Path , PathBuf } ;
33use std:: process:: Command ;
44
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:: {
88 maybe_incremental, remove_dir_if_exists, spawn_and_wait, try_hard_link, CargoProject , Compiler ,
99 LogGroup ,
1010} ;
11- use super :: { CodegenBackend , SysrootKind } ;
11+ use crate :: { config , CodegenBackend , SysrootKind } ;
1212
1313static DIST_DIR : RelPath = RelPath :: DIST ;
1414static BIN_DIR : RelPath = RelPath :: DIST . join ( "bin" ) ;
@@ -128,8 +128,8 @@ pub(crate) fn build_sysroot(
128128 cargo : bootstrap_host_compiler. cargo . clone ( ) ,
129129 rustc : rustc_clif. clone ( ) ,
130130 rustdoc : rustdoc_clif. clone ( ) ,
131- rustflags : String :: new ( ) ,
132- rustdocflags : String :: new ( ) ,
131+ rustflags : vec ! [ ] ,
132+ rustdocflags : vec ! [ ] ,
133133 triple : target_triple,
134134 runner : vec ! [ ] ,
135135 }
@@ -185,7 +185,7 @@ fn build_sysroot_for_triple(
185185
186186#[ must_use]
187187fn 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 ) ;
189189
190190 let mut target_libs = SysrootTarget { triple : compiler. triple , libs : vec ! [ ] } ;
191191
@@ -234,32 +234,32 @@ fn build_clif_sysroot_for_triple(
234234
235235 let build_dir = STANDARD_LIBRARY . target_dir ( dirs) . join ( & compiler. triple ) . join ( channel) ;
236236
237- if !super :: config:: get_bool ( "keep_sysroot" ) {
237+ if !config:: get_bool ( "keep_sysroot" ) {
238238 // Cleanup the deps dir, but keep build scripts and the incremental cache for faster
239239 // recompilation as they are not affected by changes in cg_clif.
240240 remove_dir_if_exists ( & build_dir. join ( "deps" ) ) ;
241241 }
242242
243243 // 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 ( ) ] ;
245245 match cg_clif_dylib_path {
246246 CodegenBackend :: Local ( path) => {
247- rustflags. push_str ( & format ! ( " -Zcodegen-backend={}" , path. to_str( ) . unwrap( ) ) ) ;
247+ rustflags. push ( format ! ( "-Zcodegen-backend={}" , path. to_str( ) . unwrap( ) ) ) ;
248248 }
249249 CodegenBackend :: Builtin ( name) => {
250- rustflags. push_str ( & format ! ( " -Zcodegen-backend={name}" ) ) ;
250+ rustflags. push ( format ! ( "-Zcodegen-backend={name}" ) ) ;
251251 }
252252 } ;
253253 // 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 ( ) ) ;
256256 if channel == "release" {
257257 // Incremental compilation by default disables mir inlining. This leads to both a decent
258258 // compile perf and a significant runtime perf regression. As such forcefully enable mir
259259 // inlining.
260- rustflags. push_str ( " -Zinline-mir") ;
260+ rustflags. push ( " -Zinline-mir". to_owned ( ) ) ;
261261 }
262- compiler. rustflags += & rustflags;
262+ compiler. rustflags . extend ( rustflags) ;
263263 let mut build_cmd = STANDARD_LIBRARY . build ( & compiler, dirs) ;
264264 maybe_incremental ( & mut build_cmd) ;
265265 if channel == "release" {
@@ -289,8 +289,8 @@ fn build_clif_sysroot_for_triple(
289289}
290290
291291fn 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 ) ;
294294 }
295295
296296 if !compiler. triple . ends_with ( "windows-gnu" ) {
@@ -306,6 +306,7 @@ fn build_rtstartup(dirs: &Dirs, compiler: &Compiler) -> Option<SysrootTarget> {
306306 let obj = RTSTARTUP_SYSROOT . to_path ( dirs) . join ( format ! ( "{file}.o" ) ) ;
307307 let mut build_rtstartup_cmd = Command :: new ( & compiler. rustc ) ;
308308 build_rtstartup_cmd
309+ . arg ( "-Ainternal_features" ) // Missing #[allow(internal_features)]
309310 . arg ( "--target" )
310311 . arg ( & compiler. triple )
311312 . arg ( "--emit=obj" )
0 commit comments