Skip to content

Commit cee430b

Browse files
committed
Add super_local method to the MIR visitors.
`visit_local` is the only method that doesn't call a corresponding `super_local` method. This is valid, because `super_local` would be empty. But it's inconsistent with every other case; we have multiple other empty `super` methods: `super_span`, `super_ty`, etc. This commit adds an empty `super_local` and makes `visit_local` call it.
1 parent 5986ff0 commit cee430b

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

compiler/rustc_middle/src/mir/visit.rs

+14-4
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,12 @@ macro_rules! make_mir_visitor {
270270

271271
fn visit_local(
272272
&mut self,
273-
_local: $(& $mutability)? Local,
274-
_context: PlaceContext,
275-
_location: Location,
276-
) {}
273+
local: $(& $mutability)? Local,
274+
context: PlaceContext,
275+
location: Location,
276+
) {
277+
self.super_local(local, context, location)
278+
}
277279

278280
fn visit_source_scope(
279281
&mut self,
@@ -868,6 +870,14 @@ macro_rules! make_mir_visitor {
868870
}
869871
}
870872

873+
fn super_local(
874+
&mut self,
875+
_local: $(& $mutability)? Local,
876+
_context: PlaceContext,
877+
_location: Location,
878+
) {
879+
}
880+
871881
fn super_var_debug_info(
872882
&mut self,
873883
var_debug_info: & $($mutability)? VarDebugInfo<'tcx>

0 commit comments

Comments
 (0)