Skip to content

Commit cb5e94b

Browse files
committed
Remove box syntax from doctest.rs
Doctests are fairly cold code, so even if there is a regression, which i doubt, it won't matter.
1 parent 94a0923 commit cb5e94b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/librustdoc/doctest.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub(crate) fn run(options: RustdocOptions) -> Result<(), ErrorGuaranteed> {
103103
diagnostic_output: DiagnosticOutput::Default,
104104
lint_caps,
105105
parse_sess_created: None,
106-
register_lints: Some(box crate::lint::register_lints),
106+
register_lints: Some(Box::new(crate::lint::register_lints)),
107107
override_queries: None,
108108
make_codegen_backend: None,
109109
registry: rustc_driver::diagnostics_registry(),
@@ -556,7 +556,7 @@ pub(crate) fn make_test(
556556
.supports_color();
557557

558558
let emitter = EmitterWriter::new(
559-
box io::sink(),
559+
Box::new(io::sink()),
560560
None,
561561
None,
562562
fallback_bundle,
@@ -568,7 +568,7 @@ pub(crate) fn make_test(
568568
);
569569

570570
// FIXME(misdreavus): pass `-Z treat-err-as-bug` to the doctest parser
571-
let handler = Handler::with_emitter(false, None, box emitter);
571+
let handler = Handler::with_emitter(false, None, Box::new(emitter));
572572
let sess = ParseSess::with_span_handler(handler, sm);
573573

574574
let mut found_main = false;
@@ -1005,7 +1005,7 @@ impl Tester for Collector {
10051005

10061006
if let Err(err) = std::fs::create_dir_all(&path) {
10071007
eprintln!("Couldn't create directory for doctest executables: {}", err);
1008-
panic::resume_unwind(box ());
1008+
panic::resume_unwind(Box::new(()));
10091009
}
10101010

10111011
DirState::Perm(path)
@@ -1034,7 +1034,7 @@ impl Tester for Collector {
10341034
no_run,
10351035
test_type: test::TestType::DocTest,
10361036
},
1037-
testfn: test::DynTestFn(box move || {
1037+
testfn: test::DynTestFn(Box::new(move || {
10381038
let report_unused_externs = |uext| {
10391039
unused_externs.lock().unwrap().push(uext);
10401040
};
@@ -1105,9 +1105,9 @@ impl Tester for Collector {
11051105
}
11061106
}
11071107

1108-
panic::resume_unwind(box ());
1108+
panic::resume_unwind(Box::new(()));
11091109
}
1110-
}),
1110+
})),
11111111
});
11121112
}
11131113

0 commit comments

Comments
 (0)