From 232a4a28818d0056677d48932f15d8b0cd17ef32 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 12 Sep 2019 16:03:38 -0300 Subject: [PATCH] Destructure instead of using split_at --- src/librustc_mir/transform/instcombine.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_mir/transform/instcombine.rs b/src/librustc_mir/transform/instcombine.rs index 2b8e66e3dec..da91a8daca3 100644 --- a/src/librustc_mir/transform/instcombine.rs +++ b/src/librustc_mir/transform/instcombine.rs @@ -45,7 +45,7 @@ impl<'tcx> MutVisitor<'tcx> for InstCombineVisitor<'tcx> { ref mut base, projection: ref mut projection @ box [.., _], }) => { - let (proj_l, proj_r) = projection.split_at(projection.len() - 1); + let [proj_l @ .., proj_r] = projection; let place = Place { // Replace with dummy