@@ -27,22 +27,21 @@ use crate::core::builder::crate_description;
27
27
use crate :: core:: builder:: Cargo ;
28
28
use crate :: core:: builder:: { Builder , Kind , PathSet , RunConfig , ShouldRun , Step , TaskPath } ;
29
29
use crate :: core:: config:: { DebuginfoLevel , LlvmLibunwind , RustcLto , TargetSelection } ;
30
- use crate :: utils:: cache:: { Interned , INTERNER } ;
31
30
use crate :: utils:: helpers:: {
32
31
exe, get_clang_cl_resource_dir, is_debug_info, is_dylib, output, symlink_dir, t, up_to_date,
33
32
} ;
34
33
use crate :: LLVM_TOOLS ;
35
34
use crate :: { CLang , Compiler , DependencyType , GitRepo , Mode } ;
36
35
use filetime:: FileTime ;
37
36
38
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
37
+ #[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
39
38
pub struct Std {
40
39
pub target : TargetSelection ,
41
40
pub compiler : Compiler ,
42
41
/// Whether to build only a subset of crates in the standard library.
43
42
///
44
43
/// This shouldn't be used from other steps; see the comment on [`Rustc`].
45
- crates : Interned < Vec < String > > ,
44
+ crates : Vec < String > ,
46
45
/// When using download-rustc, we need to use a new build of `std` for running unit tests of Std itself,
47
46
/// 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.
48
47
force_recompile : bool ,
@@ -556,13 +555,13 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
556
555
cargo. rustdocflag ( "-Zcrate-attr=warn(rust_2018_idioms)" ) ;
557
556
}
558
557
559
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
558
+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
560
559
struct StdLink {
561
560
pub compiler : Compiler ,
562
561
pub target_compiler : Compiler ,
563
562
pub target : TargetSelection ,
564
563
/// Not actually used; only present to make sure the cache invalidation is correct.
565
- crates : Interned < Vec < String > > ,
564
+ crates : Vec < String > ,
566
565
/// See [`Std::force_recompile`].
567
566
force_recompile : bool ,
568
567
}
@@ -609,7 +608,7 @@ impl Step for StdLink {
609
608
} ) ;
610
609
let libdir = sysroot. join ( lib) . join ( "rustlib" ) . join ( target. triple ) . join ( "lib" ) ;
611
610
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)
613
612
} else {
614
613
let libdir = builder. sysroot_libdir ( target_compiler, target) ;
615
614
let hostdir = builder. sysroot_libdir ( target_compiler, compiler. host ) ;
@@ -815,7 +814,7 @@ fn cp_rustc_component_to_ci_sysroot(
815
814
}
816
815
}
817
816
818
- #[ derive( Debug , PartialOrd , Ord , Copy , Clone , PartialEq , Eq , Hash ) ]
817
+ #[ derive( Debug , PartialOrd , Ord , Clone , PartialEq , Eq , Hash ) ]
819
818
pub struct Rustc {
820
819
pub target : TargetSelection ,
821
820
pub compiler : Compiler ,
@@ -824,7 +823,7 @@ pub struct Rustc {
824
823
/// This should only be requested by the user, not used within rustbuild itself.
825
824
/// Using it within rustbuild can lead to confusing situation where lints are replayed
826
825
/// in two different steps.
827
- crates : Interned < Vec < String > > ,
826
+ crates : Vec < String > ,
828
827
}
829
828
830
829
impl Rustc {
@@ -1217,13 +1216,13 @@ fn rustc_llvm_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelect
1217
1216
}
1218
1217
}
1219
1218
1220
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1219
+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
1221
1220
struct RustcLink {
1222
1221
pub compiler : Compiler ,
1223
1222
pub target_compiler : Compiler ,
1224
1223
pub target : TargetSelection ,
1225
1224
/// Not actually used; only present to make sure the cache invalidation is correct.
1226
- crates : Interned < Vec < String > > ,
1225
+ crates : Vec < String > ,
1227
1226
}
1228
1227
1229
1228
impl RustcLink {
@@ -1258,11 +1257,11 @@ impl Step for RustcLink {
1258
1257
}
1259
1258
}
1260
1259
1261
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1260
+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
1262
1261
pub struct CodegenBackend {
1263
1262
pub target : TargetSelection ,
1264
1263
pub compiler : Compiler ,
1265
- pub backend : Interned < String > ,
1264
+ pub backend : String ,
1266
1265
}
1267
1266
1268
1267
fn needs_codegen_config ( run : & RunConfig < ' _ > ) -> bool {
@@ -1281,7 +1280,7 @@ pub(crate) const CODEGEN_BACKEND_PREFIX: &str = "rustc_codegen_";
1281
1280
fn is_codegen_cfg_needed ( path : & TaskPath , run : & RunConfig < ' _ > ) -> bool {
1282
1281
if path. path . to_str ( ) . unwrap ( ) . contains ( CODEGEN_BACKEND_PREFIX ) {
1283
1282
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 ) {
1285
1284
if path
1286
1285
. path
1287
1286
. to_str ( )
@@ -1318,15 +1317,15 @@ impl Step for CodegenBackend {
1318
1317
return ;
1319
1318
}
1320
1319
1321
- for & backend in run. builder . config . codegen_backends ( run. target ) {
1320
+ for backend in run. builder . config . codegen_backends ( run. target ) {
1322
1321
if backend == "llvm" {
1323
1322
continue ; // Already built as part of rustc
1324
1323
}
1325
1324
1326
1325
run. builder . ensure ( CodegenBackend {
1327
1326
target : run. target ,
1328
1327
compiler : run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ,
1329
- backend,
1328
+ backend : backend . clone ( ) ,
1330
1329
} ) ;
1331
1330
}
1332
1331
}
@@ -1391,7 +1390,7 @@ impl Step for CodegenBackend {
1391
1390
f. display( )
1392
1391
) ;
1393
1392
}
1394
- let stamp = codegen_backend_stamp ( builder, compiler, target, backend) ;
1393
+ let stamp = codegen_backend_stamp ( builder, compiler, target, & backend) ;
1395
1394
let codegen_backend = codegen_backend. to_str ( ) . unwrap ( ) ;
1396
1395
t ! ( fs:: write( stamp, codegen_backend) ) ;
1397
1396
}
@@ -1430,7 +1429,7 @@ fn copy_codegen_backends_to_sysroot(
1430
1429
continue ; // Already built as part of rustc
1431
1430
}
1432
1431
1433
- let stamp = codegen_backend_stamp ( builder, compiler, target, * backend) ;
1432
+ let stamp = codegen_backend_stamp ( builder, compiler, target, backend) ;
1434
1433
let dylib = t ! ( fs:: read_to_string( & stamp) ) ;
1435
1434
let file = Path :: new ( & dylib) ;
1436
1435
let filename = file. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
@@ -1467,7 +1466,7 @@ fn codegen_backend_stamp(
1467
1466
builder : & Builder < ' _ > ,
1468
1467
compiler : Compiler ,
1469
1468
target : TargetSelection ,
1470
- backend : Interned < String > ,
1469
+ backend : & str ,
1471
1470
) -> PathBuf {
1472
1471
builder
1473
1472
. cargo_out ( compiler, Mode :: Codegen , target)
@@ -1505,7 +1504,7 @@ impl Sysroot {
1505
1504
}
1506
1505
1507
1506
impl Step for Sysroot {
1508
- type Output = Interned < PathBuf > ;
1507
+ type Output = PathBuf ;
1509
1508
1510
1509
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
1511
1510
run. never ( )
@@ -1517,7 +1516,7 @@ impl Step for Sysroot {
1517
1516
/// That is, the sysroot for the stage0 compiler is not what the compiler
1518
1517
/// thinks it is by default, but it's the same as the default for stages
1519
1518
/// 1-3.
1520
- fn run ( self , builder : & Builder < ' _ > ) -> Interned < PathBuf > {
1519
+ fn run ( self , builder : & Builder < ' _ > ) -> PathBuf {
1521
1520
let compiler = self . compiler ;
1522
1521
let host_dir = builder. out . join ( compiler. host . triple ) ;
1523
1522
@@ -1649,7 +1648,7 @@ impl Step for Sysroot {
1649
1648
) ;
1650
1649
}
1651
1650
1652
- INTERNER . intern_path ( sysroot)
1651
+ sysroot
1653
1652
}
1654
1653
}
1655
1654
@@ -1732,15 +1731,15 @@ impl Step for Assemble {
1732
1731
// to not fail while linking the artifacts.
1733
1732
build_compiler. stage = actual_stage;
1734
1733
1735
- for & backend in builder. config . codegen_backends ( target_compiler. host ) {
1734
+ for backend in builder. config . codegen_backends ( target_compiler. host ) {
1736
1735
if backend == "llvm" {
1737
1736
continue ; // Already built as part of rustc
1738
1737
}
1739
1738
1740
1739
builder. ensure ( CodegenBackend {
1741
1740
compiler : build_compiler,
1742
1741
target : target_compiler. host ,
1743
- backend,
1742
+ backend : backend . clone ( ) ,
1744
1743
} ) ;
1745
1744
}
1746
1745
0 commit comments