@@ -63,7 +63,7 @@ macro_rules! book {
63
63
src: builder. src. join( $path) ,
64
64
parent: Some ( self ) ,
65
65
languages: $lang. into( ) ,
66
- rustdoc : None ,
66
+ rustdoc_compiler : None ,
67
67
} )
68
68
}
69
69
}
@@ -113,7 +113,7 @@ impl Step for UnstableBook {
113
113
src : builder. md_doc_out ( self . target ) . join ( "unstable-book" ) ,
114
114
parent : Some ( self ) ,
115
115
languages : vec ! [ ] ,
116
- rustdoc : None ,
116
+ rustdoc_compiler : None ,
117
117
} )
118
118
}
119
119
}
@@ -125,7 +125,7 @@ struct RustbookSrc<P: Step> {
125
125
src : PathBuf ,
126
126
parent : Option < P > ,
127
127
languages : Vec < & ' static str > ,
128
- rustdoc : Option < PathBuf > ,
128
+ rustdoc_compiler : Option < Compiler > ,
129
129
}
130
130
131
131
impl < P : Step > Step for RustbookSrc < P > {
@@ -157,14 +157,17 @@ impl<P: Step> Step for RustbookSrc<P> {
157
157
let _ = fs:: remove_dir_all ( & out) ;
158
158
159
159
let mut rustbook_cmd = builder. tool_cmd ( Tool :: Rustbook ) ;
160
- if let Some ( mut rustdoc) = self . rustdoc {
160
+
161
+ if let Some ( compiler) = self . rustdoc_compiler {
162
+ let mut rustdoc = builder. rustdoc ( compiler) ;
161
163
rustdoc. pop ( ) ;
162
164
let old_path = env:: var_os ( "PATH" ) . unwrap_or_default ( ) ;
163
165
let new_path =
164
166
env:: join_paths ( std:: iter:: once ( rustdoc) . chain ( env:: split_paths ( & old_path) ) )
165
167
. expect ( "could not add rustdoc to PATH" ) ;
166
168
167
169
rustbook_cmd. env ( "PATH" , new_path) ;
170
+ builder. add_rustc_lib_path ( compiler, & mut rustbook_cmd) ;
168
171
}
169
172
170
173
rustbook_cmd. arg ( "build" ) . arg ( & src) . arg ( "-d" ) . arg ( & out) . run ( builder) ;
@@ -240,7 +243,7 @@ impl Step for TheBook {
240
243
src : absolute_path. clone ( ) ,
241
244
parent : Some ( self ) ,
242
245
languages : vec ! [ ] ,
243
- rustdoc : None ,
246
+ rustdoc_compiler : None ,
244
247
} ) ;
245
248
246
249
// building older edition redirects
@@ -253,7 +256,7 @@ impl Step for TheBook {
253
256
// treat the other editions as not having a parent.
254
257
parent : Option :: < Self > :: None ,
255
258
languages : vec ! [ ] ,
256
- rustdoc : None ,
259
+ rustdoc_compiler : None ,
257
260
} ) ;
258
261
}
259
262
@@ -1236,7 +1239,7 @@ impl Step for RustcBook {
1236
1239
src : out_base,
1237
1240
parent : Some ( self ) ,
1238
1241
languages : vec ! [ ] ,
1239
- rustdoc : None ,
1242
+ rustdoc_compiler : None ,
1240
1243
} ) ;
1241
1244
}
1242
1245
}
@@ -1270,16 +1273,15 @@ impl Step for Reference {
1270
1273
// This is needed for generating links to the standard library using
1271
1274
// the mdbook-spec plugin.
1272
1275
builder. ensure ( compile:: Std :: new ( self . compiler , builder. config . build ) ) ;
1273
- let rustdoc = builder. rustdoc ( self . compiler ) ;
1274
1276
1275
1277
// Run rustbook/mdbook to generate the HTML pages.
1276
1278
builder. ensure ( RustbookSrc {
1277
1279
target : self . target ,
1278
1280
name : "reference" . to_owned ( ) ,
1279
1281
src : builder. src . join ( "src/doc/reference" ) ,
1282
+ rustdoc_compiler : Some ( self . compiler ) ,
1280
1283
parent : Some ( self ) ,
1281
1284
languages : vec ! [ ] ,
1282
- rustdoc : Some ( rustdoc) ,
1283
1285
} ) ;
1284
1286
}
1285
1287
}
0 commit comments