@@ -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
@@ -1218,7 +1221,7 @@ impl Step for RustcBook {
1218
1221
src : out_base,
1219
1222
parent : Some ( self ) ,
1220
1223
languages : vec ! [ ] ,
1221
- rustdoc : None ,
1224
+ rustdoc_compiler : None ,
1222
1225
} ) ;
1223
1226
}
1224
1227
}
@@ -1252,16 +1255,15 @@ impl Step for Reference {
1252
1255
// This is needed for generating links to the standard library using
1253
1256
// the mdbook-spec plugin.
1254
1257
builder. ensure ( compile:: Std :: new ( self . compiler , builder. config . build ) ) ;
1255
- let rustdoc = builder. rustdoc ( self . compiler ) ;
1256
1258
1257
1259
// Run rustbook/mdbook to generate the HTML pages.
1258
1260
builder. ensure ( RustbookSrc {
1259
1261
target : self . target ,
1260
1262
name : "reference" . to_owned ( ) ,
1261
1263
src : builder. src . join ( "src/doc/reference" ) ,
1264
+ rustdoc_compiler : Some ( self . compiler ) ,
1262
1265
parent : Some ( self ) ,
1263
1266
languages : vec ! [ ] ,
1264
- rustdoc : Some ( rustdoc) ,
1265
1267
} ) ;
1266
1268
}
1267
1269
}
0 commit comments