// FIXME(matthewjasper) We shouldn't need to use `track_errors`.
tcx.sess.track_errors(|| {
tcx.sess.time("type_collecting", || {
- for &module in tcx.hir().krate().modules.keys() {
- tcx.ensure().collect_mod_item_types(module);
- }
+ tcx.hir().for_each_module(|module| tcx.ensure().collect_mod_item_types(module))
});
})?;
// NOTE: This is copy/pasted in librustdoc/core.rs and should be kept in sync.
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.time("item_bodies_checking", || tcx.typeck_item_bodies(()));