From 624c693508e94de2c962a4341d843313e5837511 Mon Sep 17 00:00:00 2001 From: Tomasz Miąsko Date: Thu, 3 Jun 2021 00:00:00 +0000 Subject: Remove check for projections in a branch without any The else branch is taken when projection slice is empty so everything except for the call to the `visit_local` is a dead code. --- compiler/rustc_codegen_ssa/src/mir/analyze.rs | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'compiler/rustc_codegen_ssa/src/mir') diff --git a/compiler/rustc_codegen_ssa/src/mir/analyze.rs b/compiler/rustc_codegen_ssa/src/mir/analyze.rs index a5aa170dece..a040c3d7de1 100644 --- a/compiler/rustc_codegen_ssa/src/mir/analyze.rs +++ b/compiler/rustc_codegen_ssa/src/mir/analyze.rs @@ -157,20 +157,7 @@ impl> 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); } } } -- cgit 1.4.1-3-g733a5