1+ use crate :: hir:: map:: Map ;
12use crate :: ty:: TyCtxt ;
2- /* use rustc_data_structures::fx::FxHashSet;
3+ use rustc_data_structures:: fx:: FxHashSet ;
34use rustc_data_structures:: sync:: { par_iter, Lock , ParallelIterator } ;
45use rustc_hir as hir;
56use rustc_hir:: def_id:: { DefId , DefIndex , CRATE_DEF_INDEX } ;
67use rustc_hir:: intravisit;
78use rustc_hir:: itemlikevisit:: ItemLikeVisitor ;
8- use rustc_hir::{HirId, ItemLocalId};*/
9+ use rustc_hir:: { HirId , ItemLocalId } ;
910
10- pub fn check_crate ( _tcx : TyCtxt < ' _ > ) {
11- /* tcx.dep_graph.assert_ignored();
11+ pub fn check_crate ( tcx : TyCtxt < ' _ > ) {
12+ tcx. dep_graph . assert_ignored ( ) ;
1213
1314 let errors = Lock :: new ( Vec :: new ( ) ) ;
15+ let hir_map = tcx. hir ( ) ;
1416
15- par_iter(&hir_map.krate.modules).for_each(|(module_id, _)| {
17+ par_iter ( & hir_map. krate ( ) . modules ) . for_each ( |( module_id, _) | {
1618 let local_def_id = hir_map. local_def_id ( * module_id) ;
1719 hir_map. visit_item_likes_in_module (
1820 local_def_id,
@@ -25,23 +27,23 @@ pub fn check_crate(_tcx: TyCtxt<'_>) {
2527 if !errors. is_empty ( ) {
2628 let message = errors. iter ( ) . fold ( String :: new ( ) , |s1, s2| s1 + "\n " + s2) ;
2729 tcx. sess . delay_span_bug ( rustc_span:: DUMMY_SP , & message) ;
28- }*/
30+ }
2931}
30- /*
32+
3133struct HirIdValidator < ' a , ' hir > {
32- hir_map: &'a EarlyMap <'hir>,
34+ hir_map : Map < ' hir > ,
3335 owner_def_index : Option < DefIndex > ,
3436 hir_ids_seen : FxHashSet < ItemLocalId > ,
3537 errors : & ' a Lock < Vec < String > > ,
3638}
3739
3840struct OuterVisitor < ' a , ' hir > {
39- hir_map: &'a EarlyMap <'hir>,
41+ hir_map : Map < ' hir > ,
4042 errors : & ' a Lock < Vec < String > > ,
4143}
4244
4345impl < ' a , ' hir > OuterVisitor < ' a , ' hir > {
44- fn new_inner_visitor(&self, hir_map: &'a EarlyMap <'hir>) -> HirIdValidator<'a, 'hir> {
46+ fn new_inner_visitor ( & self , hir_map : Map < ' hir > ) -> HirIdValidator < ' a , ' hir > {
4547 HirIdValidator {
4648 hir_map,
4749 owner_def_index : None ,
@@ -133,7 +135,7 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
133135}
134136
135137impl < ' a , ' hir > intravisit:: Visitor < ' hir > for HirIdValidator < ' a , ' hir > {
136- type Map = EarlyMap <'hir>;
138+ type Map = Map < ' hir > ;
137139
138140 fn nested_visit_map ( & mut self ) -> intravisit:: NestedVisitorMap < Self :: Map > {
139141 intravisit:: NestedVisitorMap :: OnlyBodies ( self . hir_map )
@@ -173,4 +175,3 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for HirIdValidator<'a, 'hir> {
173175 // different owner.
174176 }
175177}
176- */
0 commit comments