From: bors Date: Wed, 22 Sep 2021 09:55:13 +0000 (+0000) Subject: Auto merge of #89134 - est31:revert_rustdoc_box_syntax, r=GuillaumeGomez X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=cfff31bc833070a00578bd6178160aeed56f28ba;hp=-c;p=rust.git Auto merge of #89134 - est31:revert_rustdoc_box_syntax, r=GuillaumeGomez Revert the rustdoc box syntax removal Reverts the rustdoc box syntax removal from #87781. It turned out to cause (minor) perf regressions. Requested in https://github.com/rust-lang/rust/pull/87781#issuecomment-922589168 --- cfff31bc833070a00578bd6178160aeed56f28ba diff --combined src/librustdoc/core.rs index 765c77d5646,e48a0c17884..ddbe68762ee --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@@ -263,7 -263,7 +263,7 @@@ crate fn create_config stderr: None, lint_caps, parse_sess_created: None, - register_lints: Some(Box::new(crate::lint::register_lints)), + register_lints: Some(box crate::lint::register_lints), override_queries: Some(|_sess, providers, _external_providers| { // Most lints will require typechecking, so just don't run them. providers.lint_mod = |_, _| {}; @@@ -329,14 -329,18 +329,14 @@@ crate fn run_global_ctxt // NOTE: This is copy/pasted from typeck/lib.rs and should be kept in sync with those changes. tcx.sess.time("item_types_checking", || { - for &module in tcx.hir().krate().modules.keys() { - tcx.ensure().check_mod_item_types(module); - } + tcx.hir().for_each_module(|module| tcx.ensure().check_mod_item_types(module)) }); tcx.sess.abort_if_errors(); tcx.sess.time("missing_docs", || { rustc_lint::check_crate(tcx, rustc_lint::builtin::MissingDoc::new); }); tcx.sess.time("check_mod_attrs", || { - for &module in tcx.hir().krate().modules.keys() { - tcx.ensure().check_mod_attrs(module); - } + tcx.hir().for_each_module(|module| tcx.ensure().check_mod_attrs(module)) }); rustc_passes::stability::check_unused_or_stable_features(tcx);