@@ -26,7 +26,7 @@ use Mode;
26
26
use build_helper:: up_to_date;
27
27
28
28
use util:: { cp_r, symlink_dir} ;
29
- use builder:: { Builder , RunConfig , ShouldRun , Step } ;
29
+ use builder:: { Builder , Compiler , RunConfig , ShouldRun , Step } ;
30
30
use tool:: Tool ;
31
31
use compile;
32
32
use cache:: { INTERNER , Interned } ;
@@ -176,6 +176,7 @@ impl Step for RustbookSrc {
176
176
177
177
#[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
178
178
pub struct TheBook {
179
+ compiler : Compiler ,
179
180
target : Interned < String > ,
180
181
name : & ' static str ,
181
182
}
@@ -191,6 +192,7 @@ impl Step for TheBook {
191
192
192
193
fn make_run ( run : RunConfig ) {
193
194
run. builder . ensure ( TheBook {
195
+ compiler : run. builder . compiler ( run. builder . top_stage , run. host ) ,
194
196
target : run. target ,
195
197
name : "book" ,
196
198
} ) ;
@@ -223,7 +225,7 @@ impl Step for TheBook {
223
225
// build the index page
224
226
let index = format ! ( "{}/index.md" , name) ;
225
227
println ! ( "Documenting book index ({})" , target) ;
226
- invoke_rustdoc ( builder, target, & index) ;
228
+ invoke_rustdoc ( builder, self . compiler , target, & index) ;
227
229
228
230
// build the redirect pages
229
231
println ! ( "Documenting book redirect pages ({})" , target) ;
@@ -232,12 +234,12 @@ impl Step for TheBook {
232
234
let path = file. path ( ) ;
233
235
let path = path. to_str ( ) . unwrap ( ) ;
234
236
235
- invoke_rustdoc ( builder, target, path) ;
237
+ invoke_rustdoc ( builder, self . compiler , target, path) ;
236
238
}
237
239
}
238
240
}
239
241
240
- fn invoke_rustdoc ( builder : & Builder , target : Interned < String > , markdown : & str ) {
242
+ fn invoke_rustdoc ( builder : & Builder , compiler : Compiler , target : Interned < String > , markdown : & str ) {
241
243
let build = builder. build ;
242
244
let out = build. doc_out ( target) ;
243
245
@@ -258,7 +260,7 @@ fn invoke_rustdoc(builder: &Builder, target: Interned<String>, markdown: &str) {
258
260
t ! ( t!( File :: create( & version_info) ) . write_all( info. as_bytes( ) ) ) ;
259
261
}
260
262
261
- let mut cmd = builder. rustdoc_cmd ( builder . compiler ( 0 , build . build ) ) ;
263
+ let mut cmd = builder. rustdoc_cmd ( compiler) ;
262
264
263
265
let out = out. join ( "book" ) ;
264
266
@@ -279,6 +281,7 @@ fn invoke_rustdoc(builder: &Builder, target: Interned<String>, markdown: &str) {
279
281
280
282
#[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
281
283
pub struct Standalone {
284
+ compiler : Compiler ,
282
285
target : Interned < String > ,
283
286
}
284
287
@@ -293,6 +296,7 @@ impl Step for Standalone {
293
296
294
297
fn make_run ( run : RunConfig ) {
295
298
run. builder . ensure ( Standalone {
299
+ compiler : run. builder . compiler ( run. builder . top_stage , run. host ) ,
296
300
target : run. target ,
297
301
} ) ;
298
302
}
@@ -308,12 +312,11 @@ impl Step for Standalone {
308
312
fn run ( self , builder : & Builder ) {
309
313
let build = builder. build ;
310
314
let target = self . target ;
315
+ let compiler = self . compiler ;
311
316
println ! ( "Documenting standalone ({})" , target) ;
312
317
let out = build. doc_out ( target) ;
313
318
t ! ( fs:: create_dir_all( & out) ) ;
314
319
315
- let compiler = builder. compiler ( 0 , build. build ) ;
316
-
317
320
let favicon = build. src . join ( "src/doc/favicon.inc" ) ;
318
321
let footer = build. src . join ( "src/doc/footer.inc" ) ;
319
322
let full_toc = build. src . join ( "src/doc/full-toc.inc" ) ;
@@ -405,6 +408,7 @@ impl Step for Std {
405
408
let out = build. doc_out ( target) ;
406
409
t ! ( fs:: create_dir_all( & out) ) ;
407
410
let compiler = builder. compiler ( stage, build. build ) ;
411
+ let rustdoc = builder. rustdoc ( compiler) ;
408
412
let compiler = if build. force_use_stage1 ( compiler, target) {
409
413
builder. compiler ( 1 , compiler. host )
410
414
} else {
@@ -414,7 +418,6 @@ impl Step for Std {
414
418
builder. ensure ( compile:: Std { compiler, target } ) ;
415
419
let out_dir = build. stage_out ( compiler, Mode :: Libstd )
416
420
. join ( target) . join ( "doc" ) ;
417
- let rustdoc = builder. rustdoc ( compiler) ;
418
421
419
422
// Here what we're doing is creating a *symlink* (directory junction on
420
423
// Windows) to the final output location. This is not done as an
@@ -490,6 +493,7 @@ impl Step for Test {
490
493
let out = build. doc_out ( target) ;
491
494
t ! ( fs:: create_dir_all( & out) ) ;
492
495
let compiler = builder. compiler ( stage, build. build ) ;
496
+ let rustdoc = builder. rustdoc ( compiler) ;
493
497
let compiler = if build. force_use_stage1 ( compiler, target) {
494
498
builder. compiler ( 1 , compiler. host )
495
499
} else {
@@ -502,7 +506,6 @@ impl Step for Test {
502
506
builder. ensure ( compile:: Test { compiler, target } ) ;
503
507
let out_dir = build. stage_out ( compiler, Mode :: Libtest )
504
508
. join ( target) . join ( "doc" ) ;
505
- let rustdoc = builder. rustdoc ( compiler) ;
506
509
507
510
// See docs in std above for why we symlink
508
511
let my_out = build. crate_doc_out ( target) ;
@@ -551,6 +554,7 @@ impl Step for Rustc {
551
554
let out = build. doc_out ( target) ;
552
555
t ! ( fs:: create_dir_all( & out) ) ;
553
556
let compiler = builder. compiler ( stage, build. build ) ;
557
+ let rustdoc = builder. rustdoc ( compiler) ;
554
558
let compiler = if build. force_use_stage1 ( compiler, target) {
555
559
builder. compiler ( 1 , compiler. host )
556
560
} else {
@@ -563,7 +567,6 @@ impl Step for Rustc {
563
567
builder. ensure ( compile:: Rustc { compiler, target } ) ;
564
568
let out_dir = build. stage_out ( compiler, Mode :: Librustc )
565
569
. join ( target) . join ( "doc" ) ;
566
- let rustdoc = builder. rustdoc ( compiler) ;
567
570
568
571
// See docs in std above for why we symlink
569
572
let my_out = build. crate_doc_out ( target) ;
0 commit comments