@@ -15,11 +15,12 @@ use rustc_hir::def::Res;
15
15
use rustc_hir:: def_id:: { DefId , DefIdMap , DefIdSet , LocalDefId } ;
16
16
use rustc_hir:: intravisit:: { self , Visitor } ;
17
17
use rustc_hir:: { HirId , Path } ;
18
- use rustc_interface:: interface;
19
18
use rustc_lint:: { MissingDoc , late_lint_mod} ;
20
19
use rustc_middle:: hir:: nested_filter;
21
20
use rustc_middle:: ty:: { self , ParamEnv , Ty , TyCtxt } ;
22
- use rustc_session:: config:: { self , CrateType , ErrorOutputType , Input , ResolveDocLinks } ;
21
+ use rustc_session:: config:: {
22
+ self , CrateType , ErrorOutputType , Input , OutFileName , OutputType , OutputTypes , ResolveDocLinks ,
23
+ } ;
23
24
pub ( crate ) use rustc_session:: config:: { Options , UnstableOptions } ;
24
25
use rustc_session:: { Session , lint} ;
25
26
use rustc_span:: source_map;
@@ -219,7 +220,7 @@ pub(crate) fn create_config(
219
220
remap_path_prefix,
220
221
..
221
222
} : RustdocOptions ,
222
- RenderOptions { document_private , .. } : & RenderOptions ,
223
+ render_options : & RenderOptions ,
223
224
) -> rustc_interface:: Config {
224
225
// Add the doc cfg into the doc build.
225
226
cfgs. push ( "doc" . to_string ( ) ) ;
@@ -245,8 +246,11 @@ pub(crate) fn create_config(
245
246
246
247
let crate_types =
247
248
if proc_macro_crate { vec ! [ CrateType :: ProcMacro ] } else { vec ! [ CrateType :: Rlib ] } ;
248
- let resolve_doc_links =
249
- if * document_private { ResolveDocLinks :: All } else { ResolveDocLinks :: Exported } ;
249
+ let resolve_doc_links = if render_options. document_private {
250
+ ResolveDocLinks :: All
251
+ } else {
252
+ ResolveDocLinks :: Exported
253
+ } ;
250
254
let test = scrape_examples_options. map ( |opts| opts. scrape_tests ) . unwrap_or ( false ) ;
251
255
// plays with error output here!
252
256
let sessopts = config:: Options {
@@ -269,10 +273,18 @@ pub(crate) fn create_config(
269
273
crate_name,
270
274
test,
271
275
remap_path_prefix,
276
+ output_types : if let Some ( file) = render_options. dep_info ( ) {
277
+ OutputTypes :: new ( & [ (
278
+ OutputType :: DepInfo ,
279
+ file. map ( |f| OutFileName :: Real ( f. to_path_buf ( ) ) ) ,
280
+ ) ] )
281
+ } else {
282
+ OutputTypes :: new ( & [ ] )
283
+ } ,
272
284
..Options :: default ( )
273
285
} ;
274
286
275
- interface :: Config {
287
+ rustc_interface :: Config {
276
288
opts : sessopts,
277
289
crate_cfg : cfgs,
278
290
crate_check_cfg : check_cfgs,
0 commit comments