]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #89134 - est31:revert_rustdoc_box_syntax, r=GuillaumeGomez
authorbors <bors@rust-lang.org>
Wed, 22 Sep 2021 09:55:13 +0000 (09:55 +0000)
committerbors <bors@rust-lang.org>
Wed, 22 Sep 2021 09:55:13 +0000 (09:55 +0000)
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

1  2 
src/librustdoc/core.rs

diff --combined src/librustdoc/core.rs
index 765c77d5646cc7cd70ca0e8597eb3b1ca3a621a2,e48a0c178846e65da9692896f03a81cae0e6b5f5..ddbe68762ee041b6bc3ffdf34d1ee0f6157b7433
@@@ -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);