File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -910,14 +910,16 @@ impl<'a> Builder<'a> {
910
910
/// new artifacts, it can't be used to rely on the presence of a particular
911
911
/// sysroot.
912
912
///
913
- /// See `force_use_stage1` for documentation on what each argument is.
913
+ /// See `force_use_stage1` and `force_use_stage2` for documentation on what each argument is.
914
914
pub fn compiler_for (
915
915
& self ,
916
916
stage : u32 ,
917
917
host : TargetSelection ,
918
918
target : TargetSelection ,
919
919
) -> Compiler {
920
- if self . build . force_use_stage1 ( Compiler { stage, host } , target) {
920
+ if self . build . force_use_stage2 ( ) {
921
+ self . compiler ( 2 , self . config . build )
922
+ } else if self . build . force_use_stage1 ( Compiler { stage, host } , target) {
921
923
self . compiler ( 1 , self . config . build )
922
924
} else {
923
925
self . compiler ( stage, host)
Original file line number Diff line number Diff line change @@ -1209,6 +1209,15 @@ impl Build {
1209
1209
&& ( self . hosts . iter ( ) . any ( |h| * h == target) || target == self . build )
1210
1210
}
1211
1211
1212
+ /// Checks whether the `compiler` compiling for `target` should be forced to
1213
+ /// use a stage2 compiler instead.
1214
+ ///
1215
+ /// When we download the pre-compiled version of rustc it should be forced to
1216
+ /// use a stage2 compiler.
1217
+ fn force_use_stage2 ( & self ) -> bool {
1218
+ self . config . download_rustc ( )
1219
+ }
1220
+
1212
1221
/// Given `num` in the form "a.b.c" return a "release string" which
1213
1222
/// describes the release version number.
1214
1223
///
You can’t perform that action at this time.
0 commit comments