Skip to content

Commit d213784

Browse files
committed
xpy fmt
1 parent 6782dc0 commit d213784

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

src/librustdoc/core.rs

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ use std::rc::Rc;
3232

3333
use crate::clean;
3434
use crate::clean::{AttributesExt, MAX_DEF_ID};
35-
use crate::config::{RenderInfo, OutputFormat};
3635
use crate::config::{Options as RustdocOptions, RenderOptions};
36+
use crate::config::{OutputFormat, RenderInfo};
3737
use crate::passes::{self, Condition::*, ConditionalPass};
3838

3939
pub use rustc_session::config::{CodegenOptions, DebuggingOptions, Input, Options};
@@ -457,14 +457,30 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
457457

458458
let mut global_ctxt = abort_on_err(queries.global_ctxt(), sess).take();
459459

460-
sess.time("run_global_ctxt", || global_ctxt.enter(|tcx| run_global_ctxt(tcx, resolver, default_passes, manual_passes, render_options, output_format)))
460+
sess.time("run_global_ctxt", || {
461+
global_ctxt.enter(|tcx| {
462+
run_global_ctxt(
463+
tcx,
464+
resolver,
465+
default_passes,
466+
manual_passes,
467+
render_options,
468+
output_format,
469+
)
470+
})
471+
})
461472
})
462473
})
463474
}
464475

465-
fn run_global_ctxt(tcx: TyCtxt<'_>, resolver: Rc<RefCell<interface::BoxedResolver>>,
466-
mut default_passes: passes::DefaultPassOption, mut manual_passes: Vec<String>,
467-
render_options: RenderOptions, output_format: Option<OutputFormat>) -> (clean::Crate, RenderInfo, RenderOptions) {
476+
fn run_global_ctxt(
477+
tcx: TyCtxt<'_>,
478+
resolver: Rc<RefCell<interface::BoxedResolver>>,
479+
mut default_passes: passes::DefaultPassOption,
480+
mut manual_passes: Vec<String>,
481+
render_options: RenderOptions,
482+
output_format: Option<OutputFormat>,
483+
) -> (clean::Crate, RenderInfo, RenderOptions) {
468484
// Certain queries assume that some checks were run elsewhere
469485
// (see https://github.com/rust-lang/rust/pull/73566#issuecomment-656954425),
470486
// so type-check everything other than function bodies in this crate before running lints.
@@ -543,9 +559,8 @@ fn run_global_ctxt(tcx: TyCtxt<'_>, resolver: Rc<RefCell<interface::BoxedResolve
543559
rustc_lint::builtin::MISSING_CRATE_LEVEL_DOCS,
544560
ctxt.as_local_hir_id(m.def_id).unwrap(),
545561
|lint| {
546-
let mut diag = lint.build(
547-
"no documentation found for this crate's top-level module",
548-
);
562+
let mut diag =
563+
lint.build("no documentation found for this crate's top-level module");
549564
diag.help(help);
550565
diag.emit();
551566
},
@@ -554,10 +569,8 @@ fn run_global_ctxt(tcx: TyCtxt<'_>, resolver: Rc<RefCell<interface::BoxedResolve
554569
}
555570

556571
fn report_deprecated_attr(name: &str, diag: &rustc_errors::Handler) {
557-
let mut msg = diag.struct_warn(&format!(
558-
"the `#![doc({})]` attribute is considered deprecated",
559-
name
560-
));
572+
let mut msg = diag
573+
.struct_warn(&format!("the `#![doc({})]` attribute is considered deprecated", name));
561574
msg.warn(
562575
"see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
563576
for more information",

0 commit comments

Comments
 (0)