@@ -15,11 +15,12 @@ use rustc_hir::def::Res;
1515use rustc_hir:: def_id:: { DefId , DefIdMap , DefIdSet , LocalDefId } ;
1616use rustc_hir:: intravisit:: { self , Visitor } ;
1717use rustc_hir:: { HirId , Path } ;
18- use rustc_interface:: interface;
1918use rustc_lint:: { MissingDoc , late_lint_mod} ;
2019use rustc_middle:: hir:: nested_filter;
2120use 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+ } ;
2324pub ( crate ) use rustc_session:: config:: { Options , UnstableOptions } ;
2425use rustc_session:: { Session , lint} ;
2526use rustc_span:: source_map;
@@ -219,7 +220,7 @@ pub(crate) fn create_config(
219220 remap_path_prefix,
220221 ..
221222 } : RustdocOptions ,
222- RenderOptions { document_private , .. } : & RenderOptions ,
223+ render_options : & RenderOptions ,
223224) -> rustc_interface:: Config {
224225 // Add the doc cfg into the doc build.
225226 cfgs. push ( "doc" . to_string ( ) ) ;
@@ -245,8 +246,11 @@ pub(crate) fn create_config(
245246
246247 let crate_types =
247248 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+ } ;
250254 let test = scrape_examples_options. map ( |opts| opts. scrape_tests ) . unwrap_or ( false ) ;
251255 // plays with error output here!
252256 let sessopts = config:: Options {
@@ -269,10 +273,18 @@ pub(crate) fn create_config(
269273 crate_name,
270274 test,
271275 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+ } ,
272284 ..Options :: default ( )
273285 } ;
274286
275- interface :: Config {
287+ rustc_interface :: Config {
276288 opts : sessopts,
277289 crate_cfg : cfgs,
278290 crate_check_cfg : check_cfgs,
0 commit comments