@@ -27,22 +27,21 @@ use crate::core::builder::crate_description;
2727use crate :: core:: builder:: Cargo ;
2828use crate :: core:: builder:: { Builder , Kind , PathSet , RunConfig , ShouldRun , Step , TaskPath } ;
2929use crate :: core:: config:: { DebuginfoLevel , LlvmLibunwind , RustcLto , TargetSelection } ;
30- use crate :: utils:: cache:: { Interned , INTERNER } ;
3130use crate :: utils:: helpers:: {
3231 exe, get_clang_cl_resource_dir, is_debug_info, is_dylib, output, symlink_dir, t, up_to_date,
3332} ;
3433use crate :: LLVM_TOOLS ;
3534use crate :: { CLang , Compiler , DependencyType , GitRepo , Mode } ;
3635use filetime:: FileTime ;
3736
38- #[ derive( Debug , Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
37+ #[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
3938pub struct Std {
4039 pub target : TargetSelection ,
4140 pub compiler : Compiler ,
4241 /// Whether to build only a subset of crates in the standard library.
4342 ///
4443 /// This shouldn't be used from other steps; see the comment on [`Rustc`].
45- crates : Interned < Vec < String > > ,
44+ crates : Vec < String > ,
4645 /// When using download-rustc, we need to use a new build of `std` for running unit tests of Std itself,
4746 /// but we need to use the downloaded copy of std for linking to rustdoc. Allow this to be overriden by `builder.ensure` from other steps.
4847 force_recompile : bool ,
@@ -556,13 +555,13 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
556555 cargo. rustdocflag ( "-Zcrate-attr=warn(rust_2018_idioms)" ) ;
557556}
558557
559- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
558+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
560559struct StdLink {
561560 pub compiler : Compiler ,
562561 pub target_compiler : Compiler ,
563562 pub target : TargetSelection ,
564563 /// Not actually used; only present to make sure the cache invalidation is correct.
565- crates : Interned < Vec < String > > ,
564+ crates : Vec < String > ,
566565 /// See [`Std::force_recompile`].
567566 force_recompile : bool ,
568567}
@@ -609,7 +608,7 @@ impl Step for StdLink {
609608 } ) ;
610609 let libdir = sysroot. join ( lib) . join ( "rustlib" ) . join ( target. triple ) . join ( "lib" ) ;
611610 let hostdir = sysroot. join ( lib) . join ( "rustlib" ) . join ( compiler. host . triple ) . join ( "lib" ) ;
612- ( INTERNER . intern_path ( libdir) , INTERNER . intern_path ( hostdir) )
611+ ( libdir, hostdir)
613612 } else {
614613 let libdir = builder. sysroot_libdir ( target_compiler, target) ;
615614 let hostdir = builder. sysroot_libdir ( target_compiler, compiler. host ) ;
@@ -815,7 +814,7 @@ fn cp_rustc_component_to_ci_sysroot(
815814 }
816815}
817816
818- #[ derive( Debug , PartialOrd , Ord , Copy , Clone , PartialEq , Eq , Hash ) ]
817+ #[ derive( Debug , PartialOrd , Ord , Clone , PartialEq , Eq , Hash ) ]
819818pub struct Rustc {
820819 pub target : TargetSelection ,
821820 pub compiler : Compiler ,
@@ -824,7 +823,7 @@ pub struct Rustc {
824823 /// This should only be requested by the user, not used within rustbuild itself.
825824 /// Using it within rustbuild can lead to confusing situation where lints are replayed
826825 /// in two different steps.
827- crates : Interned < Vec < String > > ,
826+ crates : Vec < String > ,
828827}
829828
830829impl Rustc {
@@ -1217,13 +1216,13 @@ fn rustc_llvm_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelect
12171216 }
12181217}
12191218
1220- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1219+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
12211220struct RustcLink {
12221221 pub compiler : Compiler ,
12231222 pub target_compiler : Compiler ,
12241223 pub target : TargetSelection ,
12251224 /// Not actually used; only present to make sure the cache invalidation is correct.
1226- crates : Interned < Vec < String > > ,
1225+ crates : Vec < String > ,
12271226}
12281227
12291228impl RustcLink {
@@ -1258,11 +1257,11 @@ impl Step for RustcLink {
12581257 }
12591258}
12601259
1261- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1260+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
12621261pub struct CodegenBackend {
12631262 pub target : TargetSelection ,
12641263 pub compiler : Compiler ,
1265- pub backend : Interned < String > ,
1264+ pub backend : String ,
12661265}
12671266
12681267fn needs_codegen_config ( run : & RunConfig < ' _ > ) -> bool {
@@ -1281,7 +1280,7 @@ pub(crate) const CODEGEN_BACKEND_PREFIX: &str = "rustc_codegen_";
12811280fn is_codegen_cfg_needed ( path : & TaskPath , run : & RunConfig < ' _ > ) -> bool {
12821281 if path. path . to_str ( ) . unwrap ( ) . contains ( CODEGEN_BACKEND_PREFIX ) {
12831282 let mut needs_codegen_backend_config = true ;
1284- for & backend in run. builder . config . codegen_backends ( run. target ) {
1283+ for backend in run. builder . config . codegen_backends ( run. target ) {
12851284 if path
12861285 . path
12871286 . to_str ( )
@@ -1318,15 +1317,15 @@ impl Step for CodegenBackend {
13181317 return ;
13191318 }
13201319
1321- for & backend in run. builder . config . codegen_backends ( run. target ) {
1320+ for backend in run. builder . config . codegen_backends ( run. target ) {
13221321 if backend == "llvm" {
13231322 continue ; // Already built as part of rustc
13241323 }
13251324
13261325 run. builder . ensure ( CodegenBackend {
13271326 target : run. target ,
13281327 compiler : run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ,
1329- backend,
1328+ backend : backend . clone ( ) ,
13301329 } ) ;
13311330 }
13321331 }
@@ -1391,7 +1390,7 @@ impl Step for CodegenBackend {
13911390 f. display( )
13921391 ) ;
13931392 }
1394- let stamp = codegen_backend_stamp ( builder, compiler, target, backend) ;
1393+ let stamp = codegen_backend_stamp ( builder, compiler, target, & backend) ;
13951394 let codegen_backend = codegen_backend. to_str ( ) . unwrap ( ) ;
13961395 t ! ( fs:: write( stamp, codegen_backend) ) ;
13971396 }
@@ -1430,7 +1429,7 @@ fn copy_codegen_backends_to_sysroot(
14301429 continue ; // Already built as part of rustc
14311430 }
14321431
1433- let stamp = codegen_backend_stamp ( builder, compiler, target, * backend) ;
1432+ let stamp = codegen_backend_stamp ( builder, compiler, target, backend) ;
14341433 let dylib = t ! ( fs:: read_to_string( & stamp) ) ;
14351434 let file = Path :: new ( & dylib) ;
14361435 let filename = file. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
@@ -1467,7 +1466,7 @@ fn codegen_backend_stamp(
14671466 builder : & Builder < ' _ > ,
14681467 compiler : Compiler ,
14691468 target : TargetSelection ,
1470- backend : Interned < String > ,
1469+ backend : & str ,
14711470) -> PathBuf {
14721471 builder
14731472 . cargo_out ( compiler, Mode :: Codegen , target)
@@ -1505,7 +1504,7 @@ impl Sysroot {
15051504}
15061505
15071506impl Step for Sysroot {
1508- type Output = Interned < PathBuf > ;
1507+ type Output = PathBuf ;
15091508
15101509 fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
15111510 run. never ( )
@@ -1517,7 +1516,7 @@ impl Step for Sysroot {
15171516 /// That is, the sysroot for the stage0 compiler is not what the compiler
15181517 /// thinks it is by default, but it's the same as the default for stages
15191518 /// 1-3.
1520- fn run ( self , builder : & Builder < ' _ > ) -> Interned < PathBuf > {
1519+ fn run ( self , builder : & Builder < ' _ > ) -> PathBuf {
15211520 let compiler = self . compiler ;
15221521 let host_dir = builder. out . join ( compiler. host . triple ) ;
15231522
@@ -1649,7 +1648,7 @@ impl Step for Sysroot {
16491648 ) ;
16501649 }
16511650
1652- INTERNER . intern_path ( sysroot)
1651+ sysroot
16531652 }
16541653}
16551654
@@ -1732,15 +1731,15 @@ impl Step for Assemble {
17321731 // to not fail while linking the artifacts.
17331732 build_compiler. stage = actual_stage;
17341733
1735- for & backend in builder. config . codegen_backends ( target_compiler. host ) {
1734+ for backend in builder. config . codegen_backends ( target_compiler. host ) {
17361735 if backend == "llvm" {
17371736 continue ; // Already built as part of rustc
17381737 }
17391738
17401739 builder. ensure ( CodegenBackend {
17411740 compiler : build_compiler,
17421741 target : target_compiler. host ,
1743- backend,
1742+ backend : backend . clone ( ) ,
17441743 } ) ;
17451744 }
17461745
0 commit comments