@@ -99,28 +99,12 @@ impl Std {
9999 deps
100100 }
101101
102- /// Returns true if the standard library will be uplifted from stage 1 for the given
103- /// `build_compiler` (which determines the stdlib stage) and `target`.
102+ /// Returns true if the standard library should be uplifted from stage 1.
104103 ///
105- /// Uplifting is enabled if we're building a stage2+ libstd, full bootstrap is
106- /// disabled and we have a stage1 libstd already compiled for the given target.
107- pub fn should_be_uplifted_from_stage_1 (
108- builder : & Builder < ' _ > ,
109- stage : u32 ,
110- target : TargetSelection ,
111- ) -> bool {
112- stage > 1
113- && !builder. config . full_bootstrap
114- // This estimates if a stage1 libstd exists for the given target. If we're not
115- // cross-compiling, it should definitely exist by the time we're building a stage2
116- // libstd.
117- // Or if we are cross-compiling, and we are building a cross-compiled rustc, then that
118- // rustc needs to link to a cross-compiled libstd, so again we should have a stage1
119- // libstd for the given target prepared.
120- // Even if we guess wrong in the cross-compiled case, the worst that should happen is
121- // that we build a fresh stage1 libstd below, and then we immediately uplift it, so we
122- // don't pay the libstd build cost twice.
123- && ( target == builder. host_target || builder. config . hosts . contains ( & target) )
104+ /// Uplifting is enabled if we're building a stage2+ libstd and full bootstrap is
105+ /// disabled.
106+ pub fn should_be_uplifted_from_stage_1 ( builder : & Builder < ' _ > , stage : u32 ) -> bool {
107+ stage > 1 && !builder. config . full_bootstrap
124108 }
125109}
126110
@@ -228,7 +212,7 @@ impl Step for Std {
228212 // Stage of the stdlib that we're building
229213 let stage = build_compiler. stage ;
230214
231- if Self :: should_be_uplifted_from_stage_1 ( builder, build_compiler. stage , target ) {
215+ if Self :: should_be_uplifted_from_stage_1 ( builder, build_compiler. stage ) {
232216 let build_compiler_for_std_to_uplift = builder. compiler ( 1 , builder. host_target ) ;
233217 let stage_1_stamp = builder. std ( build_compiler_for_std_to_uplift, target) ;
234218
0 commit comments