From cb5e94bb62308735612c9102e8ca6ee38678db12 Mon Sep 17 00:00:00 2001 From: est31 Date: Mon, 11 Jul 2022 00:05:19 +0200 Subject: [PATCH] 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. --- src/librustdoc/doctest.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index 509c4253f0f7..6b25fbebdef4 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -103,7 +103,7 @@ pub(crate) fn run(options: RustdocOptions) -> Result<(), ErrorGuaranteed> { diagnostic_output: DiagnosticOutput::Default, lint_caps, parse_sess_created: None, - register_lints: Some(box crate::lint::register_lints), + register_lints: Some(Box::new(crate::lint::register_lints)), override_queries: None, make_codegen_backend: None, registry: rustc_driver::diagnostics_registry(), @@ -556,7 +556,7 @@ pub(crate) fn make_test( .supports_color(); let emitter = EmitterWriter::new( - box io::sink(), + Box::new(io::sink()), None, None, fallback_bundle, @@ -568,7 +568,7 @@ pub(crate) fn make_test( ); // FIXME(misdreavus): pass `-Z treat-err-as-bug` to the doctest parser - let handler = Handler::with_emitter(false, None, box emitter); + let handler = Handler::with_emitter(false, None, Box::new(emitter)); let sess = ParseSess::with_span_handler(handler, sm); let mut found_main = false; @@ -1005,7 +1005,7 @@ impl Tester for Collector { if let Err(err) = std::fs::create_dir_all(&path) { eprintln!("Couldn't create directory for doctest executables: {}", err); - panic::resume_unwind(box ()); + panic::resume_unwind(Box::new(())); } DirState::Perm(path) @@ -1034,7 +1034,7 @@ impl Tester for Collector { no_run, test_type: test::TestType::DocTest, }, - testfn: test::DynTestFn(box move || { + testfn: test::DynTestFn(Box::new(move || { let report_unused_externs = |uext| { unused_externs.lock().unwrap().push(uext); }; @@ -1105,9 +1105,9 @@ impl Tester for Collector { } } - panic::resume_unwind(box ()); + panic::resume_unwind(Box::new(())); } - }), + })), }); }