File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
compiler/rustc_passes/src Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,28 @@ impl NonConstExpr {
58
58
59
59
fn check_mod_const_bodies ( tcx : TyCtxt < ' _ > , module_def_id : LocalDefId ) {
60
60
let mut vis = CheckConstVisitor :: new ( tcx) ;
61
- tcx. hir ( ) . visit_item_likes_in_module ( module_def_id, & mut vis. as_deep_visitor ( ) ) ;
62
- for id in tcx. hir_module_items ( module_def_id) . items ( ) {
61
+ let module = tcx. hir_module_items ( module_def_id) ;
62
+
63
+ for id in module. items ( ) {
64
+ vis. visit_item ( tcx. hir ( ) . item ( id) ) ;
63
65
check_item ( tcx, id) ;
64
66
}
67
+
68
+ for id in module. trait_items ( ) {
69
+ vis. visit_trait_item ( tcx. hir ( ) . trait_item ( id) ) ;
70
+ }
71
+
72
+ for id in module. impl_items ( ) {
73
+ vis. visit_impl_item ( tcx. hir ( ) . impl_item ( id) ) ;
74
+ }
75
+
76
+ for id in module. foreign_items ( ) {
77
+ vis. visit_foreign_item ( tcx. hir ( ) . foreign_item ( id) ) ;
78
+ }
79
+
80
+ // for id in tcx.hir_module_items(module_def_id).items() {
81
+ // check_item(tcx, id);
82
+ // }
65
83
}
66
84
67
85
pub ( crate ) fn provide ( providers : & mut Providers ) {
You can’t perform that action at this time.
0 commit comments