Skip to content

Commit ee5f9d1

Browse files
committed
no need to call super_place
1 parent 191eb30 commit ee5f9d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_mir/src/transform/unneeded_deref.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ struct UnneededDerefVisitor<'a, 'tcx> {
5555
}
5656

5757
impl<'a, 'tcx> Visitor<'tcx> for UnneededDerefVisitor<'a, 'tcx> {
58-
fn visit_place(&mut self, place: &Place<'tcx>, context: PlaceContext, location: Location) {
58+
fn visit_place(&mut self, place: &Place<'tcx>, _context: PlaceContext, location: Location) {
5959
let analysis = &self.results.analysis;
6060
let _: Option<_> = try {
6161
debug!("Visiting place {:?}", place);
62-
// SAFETY: We only use self.state here which is always called from statement_before_primary_effect,
62+
// SAFETY: We only use self.state here which is always called from statement_before_primary_effect,
6363
// which guarantees that self.state is still alive.
64-
let state = unsafe{self.state.as_ref().unwrap()};
64+
let state = unsafe { self.state.as_ref().unwrap() };
6565

6666
match place.as_ref() {
6767
PlaceRef { projection: [ProjectionElem::Deref], .. } => {
@@ -87,7 +87,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UnneededDerefVisitor<'a, 'tcx> {
8787
_ => None?,
8888
}
8989
};
90-
self.super_place(place, context, location);
90+
// We explicitly do not call super_place as we don't need to explore the graph deeper
9191
}
9292
}
9393

0 commit comments

Comments
 (0)