@@ -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 ,
@@ -559,13 +558,13 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
559558 cargo. rustdocflag ( "-Zcrate-attr=warn(rust_2018_idioms)" ) ;
560559}
561560
562- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
561+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
563562struct StdLink {
564563 pub compiler : Compiler ,
565564 pub target_compiler : Compiler ,
566565 pub target : TargetSelection ,
567566 /// Not actually used; only present to make sure the cache invalidation is correct.
568- crates : Interned < Vec < String > > ,
567+ crates : Vec < String > ,
569568 /// See [`Std::force_recompile`].
570569 force_recompile : bool ,
571570}
@@ -612,7 +611,7 @@ impl Step for StdLink {
612611 } ) ;
613612 let libdir = sysroot. join ( lib) . join ( "rustlib" ) . join ( target. triple ) . join ( "lib" ) ;
614613 let hostdir = sysroot. join ( lib) . join ( "rustlib" ) . join ( compiler. host . triple ) . join ( "lib" ) ;
615- ( INTERNER . intern_path ( libdir) , INTERNER . intern_path ( hostdir) )
614+ ( libdir, hostdir)
616615 } else {
617616 let libdir = builder. sysroot_libdir ( target_compiler, target) ;
618617 let hostdir = builder. sysroot_libdir ( target_compiler, compiler. host ) ;
@@ -818,7 +817,7 @@ fn cp_rustc_component_to_ci_sysroot(
818817 }
819818}
820819
821- #[ derive( Debug , PartialOrd , Ord , Copy , Clone , PartialEq , Eq , Hash ) ]
820+ #[ derive( Debug , PartialOrd , Ord , Clone , PartialEq , Eq , Hash ) ]
822821pub struct Rustc {
823822 pub target : TargetSelection ,
824823 pub compiler : Compiler ,
@@ -827,7 +826,7 @@ pub struct Rustc {
827826 /// This should only be requested by the user, not used within rustbuild itself.
828827 /// Using it within rustbuild can lead to confusing situation where lints are replayed
829828 /// in two different steps.
830- crates : Interned < Vec < String > > ,
829+ crates : Vec < String > ,
831830}
832831
833832impl Rustc {
@@ -1220,13 +1219,13 @@ fn rustc_llvm_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelect
12201219 }
12211220}
12221221
1223- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1222+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
12241223struct RustcLink {
12251224 pub compiler : Compiler ,
12261225 pub target_compiler : Compiler ,
12271226 pub target : TargetSelection ,
12281227 /// Not actually used; only present to make sure the cache invalidation is correct.
1229- crates : Interned < Vec < String > > ,
1228+ crates : Vec < String > ,
12301229}
12311230
12321231impl RustcLink {
@@ -1261,11 +1260,11 @@ impl Step for RustcLink {
12611260 }
12621261}
12631262
1264- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1263+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
12651264pub struct CodegenBackend {
12661265 pub target : TargetSelection ,
12671266 pub compiler : Compiler ,
1268- pub backend : Interned < String > ,
1267+ pub backend : String ,
12691268}
12701269
12711270fn needs_codegen_config ( run : & RunConfig < ' _ > ) -> bool {
@@ -1284,7 +1283,7 @@ pub(crate) const CODEGEN_BACKEND_PREFIX: &str = "rustc_codegen_";
12841283fn is_codegen_cfg_needed ( path : & TaskPath , run : & RunConfig < ' _ > ) -> bool {
12851284 if path. path . to_str ( ) . unwrap ( ) . contains ( CODEGEN_BACKEND_PREFIX ) {
12861285 let mut needs_codegen_backend_config = true ;
1287- for & backend in run. builder . config . codegen_backends ( run. target ) {
1286+ for backend in run. builder . config . codegen_backends ( run. target ) {
12881287 if path
12891288 . path
12901289 . to_str ( )
@@ -1321,15 +1320,15 @@ impl Step for CodegenBackend {
13211320 return ;
13221321 }
13231322
1324- for & backend in run. builder . config . codegen_backends ( run. target ) {
1323+ for backend in run. builder . config . codegen_backends ( run. target ) {
13251324 if backend == "llvm" {
13261325 continue ; // Already built as part of rustc
13271326 }
13281327
13291328 run. builder . ensure ( CodegenBackend {
13301329 target : run. target ,
13311330 compiler : run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ,
1332- backend,
1331+ backend : backend . clone ( ) ,
13331332 } ) ;
13341333 }
13351334 }
@@ -1394,7 +1393,7 @@ impl Step for CodegenBackend {
13941393 f. display( )
13951394 ) ;
13961395 }
1397- let stamp = codegen_backend_stamp ( builder, compiler, target, backend) ;
1396+ let stamp = codegen_backend_stamp ( builder, compiler, target, & backend) ;
13981397 let codegen_backend = codegen_backend. to_str ( ) . unwrap ( ) ;
13991398 t ! ( fs:: write( stamp, codegen_backend) ) ;
14001399 }
@@ -1433,7 +1432,7 @@ fn copy_codegen_backends_to_sysroot(
14331432 continue ; // Already built as part of rustc
14341433 }
14351434
1436- let stamp = codegen_backend_stamp ( builder, compiler, target, * backend) ;
1435+ let stamp = codegen_backend_stamp ( builder, compiler, target, backend) ;
14371436 let dylib = t ! ( fs:: read_to_string( & stamp) ) ;
14381437 let file = Path :: new ( & dylib) ;
14391438 let filename = file. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
@@ -1470,7 +1469,7 @@ fn codegen_backend_stamp(
14701469 builder : & Builder < ' _ > ,
14711470 compiler : Compiler ,
14721471 target : TargetSelection ,
1473- backend : Interned < String > ,
1472+ backend : & str ,
14741473) -> PathBuf {
14751474 builder
14761475 . cargo_out ( compiler, Mode :: Codegen , target)
@@ -1508,7 +1507,7 @@ impl Sysroot {
15081507}
15091508
15101509impl Step for Sysroot {
1511- type Output = Interned < PathBuf > ;
1510+ type Output = PathBuf ;
15121511
15131512 fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
15141513 run. never ( )
@@ -1520,7 +1519,7 @@ impl Step for Sysroot {
15201519 /// That is, the sysroot for the stage0 compiler is not what the compiler
15211520 /// thinks it is by default, but it's the same as the default for stages
15221521 /// 1-3.
1523- fn run ( self , builder : & Builder < ' _ > ) -> Interned < PathBuf > {
1522+ fn run ( self , builder : & Builder < ' _ > ) -> PathBuf {
15241523 let compiler = self . compiler ;
15251524 let host_dir = builder. out . join ( compiler. host . triple ) ;
15261525
@@ -1652,7 +1651,7 @@ impl Step for Sysroot {
16521651 ) ;
16531652 }
16541653
1655- INTERNER . intern_path ( sysroot)
1654+ sysroot
16561655 }
16571656}
16581657
@@ -1735,15 +1734,15 @@ impl Step for Assemble {
17351734 // to not fail while linking the artifacts.
17361735 build_compiler. stage = actual_stage;
17371736
1738- for & backend in builder. config . codegen_backends ( target_compiler. host ) {
1737+ for backend in builder. config . codegen_backends ( target_compiler. host ) {
17391738 if backend == "llvm" {
17401739 continue ; // Already built as part of rustc
17411740 }
17421741
17431742 builder. ensure ( CodegenBackend {
17441743 compiler : build_compiler,
17451744 target : target_compiler. host ,
1746- backend,
1745+ backend : backend . clone ( ) ,
17471746 } ) ;
17481747 }
17491748
0 commit comments