File tree Expand file tree Collapse file tree 1 file changed +3
-15
lines changed
src/librustc_mir/hair/pattern Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -28,22 +28,10 @@ use syntax::ast;
28
28
use syntax:: ptr:: P ;
29
29
use syntax_pos:: { Span , DUMMY_SP , MultiSpan } ;
30
30
31
- struct OuterVisitor < ' a , ' tcx : ' a > { tcx : TyCtxt < ' a , ' tcx , ' tcx > }
32
-
33
- impl < ' a , ' tcx > Visitor < ' tcx > for OuterVisitor < ' a , ' tcx > {
34
- fn nested_visit_map < ' this > ( & ' this mut self ) -> NestedVisitorMap < ' this , ' tcx > {
35
- NestedVisitorMap :: OnlyBodies ( & self . tcx . hir ( ) )
36
- }
37
-
38
- fn visit_body ( & mut self , body : & ' tcx hir:: Body ) {
39
- intravisit:: walk_body ( self , body) ;
40
- let def_id = self . tcx . hir ( ) . body_owner_def_id ( body. id ( ) ) ;
41
- let _ = self . tcx . check_match ( def_id) ;
42
- }
43
- }
44
-
45
31
pub fn check_crate < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) {
46
- tcx. hir ( ) . krate ( ) . visit_all_item_likes ( & mut OuterVisitor { tcx } . as_deep_visitor ( ) ) ;
32
+ for def_id in tcx. body_owners ( ) {
33
+ tcx. ensure ( ) . check_match ( def_id) ;
34
+ }
47
35
tcx. sess . abort_if_errors ( ) ;
48
36
}
49
37
You can’t perform that action at this time.
0 commit comments