@@ -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 ,
@@ -559,13 +558,13 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
559
558
cargo. rustdocflag ( "-Zcrate-attr=warn(rust_2018_idioms)" ) ;
560
559
}
561
560
562
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
561
+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
563
562
struct StdLink {
564
563
pub compiler : Compiler ,
565
564
pub target_compiler : Compiler ,
566
565
pub target : TargetSelection ,
567
566
/// Not actually used; only present to make sure the cache invalidation is correct.
568
- crates : Interned < Vec < String > > ,
567
+ crates : Vec < String > ,
569
568
/// See [`Std::force_recompile`].
570
569
force_recompile : bool ,
571
570
}
@@ -612,7 +611,7 @@ impl Step for StdLink {
612
611
} ) ;
613
612
let libdir = sysroot. join ( lib) . join ( "rustlib" ) . join ( target. triple ) . join ( "lib" ) ;
614
613
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)
616
615
} else {
617
616
let libdir = builder. sysroot_libdir ( target_compiler, target) ;
618
617
let hostdir = builder. sysroot_libdir ( target_compiler, compiler. host ) ;
@@ -818,7 +817,7 @@ fn cp_rustc_component_to_ci_sysroot(
818
817
}
819
818
}
820
819
821
- #[ derive( Debug , PartialOrd , Ord , Copy , Clone , PartialEq , Eq , Hash ) ]
820
+ #[ derive( Debug , PartialOrd , Ord , Clone , PartialEq , Eq , Hash ) ]
822
821
pub struct Rustc {
823
822
pub target : TargetSelection ,
824
823
pub compiler : Compiler ,
@@ -827,7 +826,7 @@ pub struct Rustc {
827
826
/// This should only be requested by the user, not used within rustbuild itself.
828
827
/// Using it within rustbuild can lead to confusing situation where lints are replayed
829
828
/// in two different steps.
830
- crates : Interned < Vec < String > > ,
829
+ crates : Vec < String > ,
831
830
}
832
831
833
832
impl Rustc {
@@ -1220,13 +1219,13 @@ fn rustc_llvm_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelect
1220
1219
}
1221
1220
}
1222
1221
1223
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1222
+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
1224
1223
struct RustcLink {
1225
1224
pub compiler : Compiler ,
1226
1225
pub target_compiler : Compiler ,
1227
1226
pub target : TargetSelection ,
1228
1227
/// Not actually used; only present to make sure the cache invalidation is correct.
1229
- crates : Interned < Vec < String > > ,
1228
+ crates : Vec < String > ,
1230
1229
}
1231
1230
1232
1231
impl RustcLink {
@@ -1261,11 +1260,11 @@ impl Step for RustcLink {
1261
1260
}
1262
1261
}
1263
1262
1264
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
1263
+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
1265
1264
pub struct CodegenBackend {
1266
1265
pub target : TargetSelection ,
1267
1266
pub compiler : Compiler ,
1268
- pub backend : Interned < String > ,
1267
+ pub backend : String ,
1269
1268
}
1270
1269
1271
1270
fn needs_codegen_config ( run : & RunConfig < ' _ > ) -> bool {
@@ -1284,7 +1283,7 @@ pub(crate) const CODEGEN_BACKEND_PREFIX: &str = "rustc_codegen_";
1284
1283
fn is_codegen_cfg_needed ( path : & TaskPath , run : & RunConfig < ' _ > ) -> bool {
1285
1284
if path. path . to_str ( ) . unwrap ( ) . contains ( CODEGEN_BACKEND_PREFIX ) {
1286
1285
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 ) {
1288
1287
if path
1289
1288
. path
1290
1289
. to_str ( )
@@ -1321,15 +1320,15 @@ impl Step for CodegenBackend {
1321
1320
return ;
1322
1321
}
1323
1322
1324
- for & backend in run. builder . config . codegen_backends ( run. target ) {
1323
+ for backend in run. builder . config . codegen_backends ( run. target ) {
1325
1324
if backend == "llvm" {
1326
1325
continue ; // Already built as part of rustc
1327
1326
}
1328
1327
1329
1328
run. builder . ensure ( CodegenBackend {
1330
1329
target : run. target ,
1331
1330
compiler : run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ,
1332
- backend,
1331
+ backend : backend . clone ( ) ,
1333
1332
} ) ;
1334
1333
}
1335
1334
}
@@ -1394,7 +1393,7 @@ impl Step for CodegenBackend {
1394
1393
f. display( )
1395
1394
) ;
1396
1395
}
1397
- let stamp = codegen_backend_stamp ( builder, compiler, target, backend) ;
1396
+ let stamp = codegen_backend_stamp ( builder, compiler, target, & backend) ;
1398
1397
let codegen_backend = codegen_backend. to_str ( ) . unwrap ( ) ;
1399
1398
t ! ( fs:: write( stamp, codegen_backend) ) ;
1400
1399
}
@@ -1433,7 +1432,7 @@ fn copy_codegen_backends_to_sysroot(
1433
1432
continue ; // Already built as part of rustc
1434
1433
}
1435
1434
1436
- let stamp = codegen_backend_stamp ( builder, compiler, target, * backend) ;
1435
+ let stamp = codegen_backend_stamp ( builder, compiler, target, backend) ;
1437
1436
let dylib = t ! ( fs:: read_to_string( & stamp) ) ;
1438
1437
let file = Path :: new ( & dylib) ;
1439
1438
let filename = file. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
@@ -1470,7 +1469,7 @@ fn codegen_backend_stamp(
1470
1469
builder : & Builder < ' _ > ,
1471
1470
compiler : Compiler ,
1472
1471
target : TargetSelection ,
1473
- backend : Interned < String > ,
1472
+ backend : & str ,
1474
1473
) -> PathBuf {
1475
1474
builder
1476
1475
. cargo_out ( compiler, Mode :: Codegen , target)
@@ -1508,7 +1507,7 @@ impl Sysroot {
1508
1507
}
1509
1508
1510
1509
impl Step for Sysroot {
1511
- type Output = Interned < PathBuf > ;
1510
+ type Output = PathBuf ;
1512
1511
1513
1512
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
1514
1513
run. never ( )
@@ -1520,7 +1519,7 @@ impl Step for Sysroot {
1520
1519
/// That is, the sysroot for the stage0 compiler is not what the compiler
1521
1520
/// thinks it is by default, but it's the same as the default for stages
1522
1521
/// 1-3.
1523
- fn run ( self , builder : & Builder < ' _ > ) -> Interned < PathBuf > {
1522
+ fn run ( self , builder : & Builder < ' _ > ) -> PathBuf {
1524
1523
let compiler = self . compiler ;
1525
1524
let host_dir = builder. out . join ( compiler. host . triple ) ;
1526
1525
@@ -1652,7 +1651,7 @@ impl Step for Sysroot {
1652
1651
) ;
1653
1652
}
1654
1653
1655
- INTERNER . intern_path ( sysroot)
1654
+ sysroot
1656
1655
}
1657
1656
}
1658
1657
@@ -1735,15 +1734,15 @@ impl Step for Assemble {
1735
1734
// to not fail while linking the artifacts.
1736
1735
build_compiler. stage = actual_stage;
1737
1736
1738
- for & backend in builder. config . codegen_backends ( target_compiler. host ) {
1737
+ for backend in builder. config . codegen_backends ( target_compiler. host ) {
1739
1738
if backend == "llvm" {
1740
1739
continue ; // Already built as part of rustc
1741
1740
}
1742
1741
1743
1742
builder. ensure ( CodegenBackend {
1744
1743
compiler : build_compiler,
1745
1744
target : target_compiler. host ,
1746
- backend,
1745
+ backend : backend . clone ( ) ,
1747
1746
} ) ;
1748
1747
}
1749
1748
0 commit comments