Skip to content

Commit fe143a2

Browse files
Don't show suggestion if slice pattern is enclosed by any patterns
1 parent 648987c commit fe143a2

File tree

1 file changed

+1
-3
lines changed
  • compiler/rustc_hir_typeck/src

1 file changed

+1
-3
lines changed

compiler/rustc_hir_typeck/src/pat.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -2341,9 +2341,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
23412341
_ => (),
23422342
}
23432343

2344-
let enclosure_is_struct =
2345-
parent_kind.map_or(false, |enclosure| matches!(enclosure, PatKind::Struct(..)));
2346-
2344+
let enclosure_is_struct = parent_kind.is_some();
23472345
if is_slice_or_array_or_vector && !enclosure_is_struct {
23482346
err.span_suggestion(
23492347
span,

0 commit comments

Comments
 (0)