From 0cee527869f96e0c51487303a6c9dcf6fabc0e14 Mon Sep 17 00:00:00 2001 From: ayushmishra2005 Date: Thu, 13 May 2021 10:22:17 +0530 Subject: [PATCH 1/2] Miner code formatting --- compiler/rustc_mir/src/dataflow/move_paths/builder.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/rustc_mir/src/dataflow/move_paths/builder.rs b/compiler/rustc_mir/src/dataflow/move_paths/builder.rs index 994b403abf3..449799f9178 100644 --- a/compiler/rustc_mir/src/dataflow/move_paths/builder.rs +++ b/compiler/rustc_mir/src/dataflow/move_paths/builder.rs @@ -137,10 +137,7 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> { self.loc, InteriorOfSliceOrArray { ty: place_ty, - is_index: match elem { - ProjectionElem::Index(..) => true, - _ => false, - }, + is_index: matches!(elem, ProjectionElem::Index(..)) }, )); } From 267450a81473a68dcef84ab7ba5e65265a0dd08c Mon Sep 17 00:00:00 2001 From: ayushmishra2005 Date: Thu, 13 May 2021 10:34:41 +0530 Subject: [PATCH 2/2] removed compilation error --- compiler/rustc_mir/src/dataflow/move_paths/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_mir/src/dataflow/move_paths/builder.rs b/compiler/rustc_mir/src/dataflow/move_paths/builder.rs index 449799f9178..1bfbb843114 100644 --- a/compiler/rustc_mir/src/dataflow/move_paths/builder.rs +++ b/compiler/rustc_mir/src/dataflow/move_paths/builder.rs @@ -137,7 +137,7 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> { self.loc, InteriorOfSliceOrArray { ty: place_ty, - is_index: matches!(elem, ProjectionElem::Index(..)) + is_index: matches!(elem, ProjectionElem::Index(..)), }, )); }