Skip to content

Commit 8e78f4a

Browse files
Backport 572c405 to 1.53
This fixes a Clippy ICE on rustc std and the crates.io codebase (and potentially others).
1 parent dbe03e2 commit 8e78f4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/tools/clippy/clippy_lints/src/matches.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1590,9 +1590,9 @@ fn is_none_arm(cx: &LateContext<'_>, arm: &Arm<'_>) -> bool {
15901590
// Checks if arm has the form `Some(ref v) => Some(v)` (checks for `ref` and `ref mut`)
15911591
fn is_ref_some_arm(cx: &LateContext<'_>, arm: &Arm<'_>) -> Option<BindingAnnotation> {
15921592
if_chain! {
1593-
if let PatKind::TupleStruct(ref qpath, pats, _) = arm.pat.kind;
1593+
if let PatKind::TupleStruct(ref qpath, [first_pat, ..], _) = arm.pat.kind;
15941594
if is_lang_ctor(cx, qpath, OptionSome);
1595-
if let PatKind::Binding(rb, .., ident, _) = pats[0].kind;
1595+
if let PatKind::Binding(rb, .., ident, _) = first_pat.kind;
15961596
if rb == BindingAnnotation::Ref || rb == BindingAnnotation::RefMut;
15971597
if let ExprKind::Call(e, args) = remove_blocks(arm.body).kind;
15981598
if let ExprKind::Path(ref some_path) = e.kind;

0 commit comments

Comments
 (0)