File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -937,10 +937,11 @@ impl<'tcx> Delegate<'tcx> for DerefDelegate<'_, 'tcx> {
937937 // note: unable to trigger `Subslice` kind in tests
938938 ProjectionKind :: Subslice => ( ) ,
939939 ProjectionKind :: Deref => {
940- // explicit deref for arrays should be avoided in the suggestion
941- // i.e.: `|sub| *sub[1..4].len() == 3` is not expected
940+ // Explicit derefs are typically handled later on, but
941+ // some items do not need explicit deref, such as array accesses,
942+ // so we mark them as already processed
943+ // i.e.: don't suggest `*sub[1..4].len()` for `|sub| sub[1..4].len() == 3`
942944 if let ty:: Ref ( _, inner, _) = cmt. place . ty_before_projection ( i) . kind ( ) {
943- // dereferencing an array (i.e.: `|sub| sub[1..4].len() == 3`)
944945 if matches ! ( inner. kind( ) , ty:: Ref ( _, innermost, _) if innermost. is_array( ) ) {
945946 projections_handled = true ;
946947 }
You can’t perform that action at this time.
0 commit comments