File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 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> {
910910 /// new artifacts, it can't be used to rely on the presence of a particular
911911 /// sysroot.
912912 ///
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.
914914 pub fn compiler_for (
915915 & self ,
916916 stage : u32 ,
917917 host : TargetSelection ,
918918 target : TargetSelection ,
919919 ) -> 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) {
921923 self . compiler ( 1 , self . config . build )
922924 } else {
923925 self . compiler ( stage, host)
Original file line number Diff line number Diff line change @@ -1209,6 +1209,15 @@ impl Build {
12091209 && ( self . hosts . iter ( ) . any ( |h| * h == target) || target == self . build )
12101210 }
12111211
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+
12121221 /// Given `num` in the form "a.b.c" return a "release string" which
12131222 /// describes the release version number.
12141223 ///
You can’t perform that action at this time.
0 commit comments