Skip to content

Commit

Permalink
Remove check for projections in a branch without any
Browse files Browse the repository at this point in the history
The else branch is taken when projection slice is empty so everything
except for the call to the `visit_local` is a dead code.
  • Loading branch information
tmiasko committed Jun 3, 2021
1 parent 59b6583 commit 624c693
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions compiler/rustc_codegen_ssa/src/mir/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,7 @@ impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
);
}
} else {
// FIXME this is super_place code, is repeated here to avoid cloning place or changing
// visit_place API
let mut context = context;

if !place_ref.projection.is_empty() {
context = if context.is_mutating_use() {
PlaceContext::MutatingUse(MutatingUseContext::Projection)
} else {
PlaceContext::NonMutatingUse(NonMutatingUseContext::Projection)
};
}

self.visit_local(&place_ref.local, context, location);
self.visit_projection(*place_ref, context, location);
}
}
}
Expand Down

0 comments on commit 624c693

Please sign in to comment.