@@ -273,12 +273,9 @@ where
273
273
( lint_opts, lint_caps)
274
274
}
275
275
276
- crate fn run_core (
277
- options : RustdocOptions ,
278
- ) -> ( clean:: Crate , RenderInfo , RenderOptions , Lrc < Session > ) {
279
- // Parse, resolve, and typecheck the given crate.
280
-
281
- let RustdocOptions {
276
+ /// Parse, resolve, and typecheck the given crate.
277
+ fn create_config (
278
+ RustdocOptions {
282
279
input,
283
280
crate_name,
284
281
proc_macro_crate,
@@ -294,21 +291,10 @@ crate fn run_core(
294
291
lint_opts,
295
292
describe_lints,
296
293
lint_cap,
297
- default_passes,
298
- manual_passes,
299
294
display_warnings,
300
- render_options,
301
- output_format,
302
295
..
303
- } = options;
304
-
305
- let extern_names: Vec < String > = externs
306
- . iter ( )
307
- . filter ( |( _, entry) | entry. add_prelude )
308
- . map ( |( name, _) | name)
309
- . cloned ( )
310
- . collect ( ) ;
311
-
296
+ } : RustdocOptions ,
297
+ ) -> rustc_interface:: Config {
312
298
// Add the doc cfg into the doc build.
313
299
cfgs. push ( "doc" . to_string ( ) ) ;
314
300
@@ -374,7 +360,7 @@ crate fn run_core(
374
360
..Options :: default ( )
375
361
} ;
376
362
377
- let config = interface:: Config {
363
+ interface:: Config {
378
364
opts : sessopts,
379
365
crate_cfg : interface:: parse_cfgspecs ( cfgs) ,
380
366
input,
@@ -417,7 +403,25 @@ crate fn run_core(
417
403
} ) ,
418
404
make_codegen_backend : None ,
419
405
registry : rustc_driver:: diagnostics_registry ( ) ,
420
- } ;
406
+ }
407
+ }
408
+
409
+ crate fn run_core (
410
+ options : RustdocOptions ,
411
+ ) -> ( clean:: Crate , RenderInfo , RenderOptions , Lrc < Session > ) {
412
+ let extern_names: Vec < String > = options
413
+ . externs
414
+ . iter ( )
415
+ . filter ( |( _, entry) | entry. add_prelude )
416
+ . map ( |( name, _) | name)
417
+ . cloned ( )
418
+ . collect ( ) ;
419
+ let default_passes = options. default_passes ;
420
+ let output_format = options. output_format ;
421
+ // TODO: fix this clone (especially render_options)
422
+ let manual_passes = options. manual_passes . clone ( ) ;
423
+ let render_options = options. render_options . clone ( ) ;
424
+ let config = create_config ( options) ;
421
425
422
426
interface:: create_compiler_and_run ( config, |compiler| {
423
427
compiler. enter ( |queries| {
0 commit comments