From 5cd51c0edd2118b8799f6c8656e3753afd411e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Sat, 16 May 2026 00:33:43 +0000 Subject: [PATCH] Place comment in the right place --- compiler/rustc_borrowck/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index 107ca8737601..e80969cd0cbb 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -2239,14 +2239,14 @@ fn check_if_assigned_path_is_moved( // None case => assigning to `x` does not require `x` be initialized. for (place_base, elem) in place.iter_projections().rev() { match elem { - ProjectionElem::Index(_/*operand*/) | - ProjectionElem::OpaqueCast(_) | - ProjectionElem::ConstantIndex { .. } | + ProjectionElem::Index(_/*operand*/) + | ProjectionElem::OpaqueCast(_) // assigning to P[i] requires P to be valid. - ProjectionElem::Downcast(_/*adt_def*/, _/*variant_idx*/) => - // assigning to (P->variant) is okay if assigning to `P` is okay - // - // FIXME: is this true even if P is an adt with a dtor? + | ProjectionElem::ConstantIndex { .. } + // assigning to (P->variant) is okay if assigning to `P` is okay + // + // FIXME: is this true even if P is an adt with a dtor? + | ProjectionElem::Downcast(_/*adt_def*/, _/*variant_idx*/) => {} ProjectionElem::UnwrapUnsafeBinder(_) => {