From d6efedcaf578e67f07293349d2128c06043a239f Mon Sep 17 00:00:00 2001 From: ouz-a Date: Fri, 22 Sep 2023 11:21:55 +0300 Subject: [PATCH] remove inner match --- compiler/rustc_mir_dataflow/src/move_paths/builder.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs index 31efa26a6aa..d19b1a902f4 100644 --- a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs +++ b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs @@ -208,12 +208,10 @@ fn move_path_for(&mut self, place: Place<'tcx>) -> Result match place_ty.kind() { ty::Array(..) => { - if let ProjectionElem::Index(..) = elem { - return Err(MoveError::cannot_move_out_of( - self.loc, - InteriorOfSliceOrArray { ty: place_ty, is_index: true }, - )); - } + return Err(MoveError::cannot_move_out_of( + self.loc, + InteriorOfSliceOrArray { ty: place_ty, is_index: true }, + )); } ty::Slice(_) => { return Err(MoveError::cannot_move_out_of(