Skip to content

Commit 0026034

Browse files
committed
replace usage of visit_item_likes_in_modules with hir_module_items query
Signed-off-by: Miguel Guarniz <[email protected]>
1 parent bd2b210 commit 0026034

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

compiler/rustc_passes/src/check_const.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,28 @@ impl NonConstExpr {
5858

5959
fn check_mod_const_bodies(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
6060
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));
6365
check_item(tcx, id);
6466
}
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+
// }
6583
}
6684

6785
pub(crate) fn provide(providers: &mut Providers) {

0 commit comments

Comments
 (0)