Auto merge of #86390 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum · rust-lang/rust@53cb7b0 (original) (raw)

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -1590,9 +1590,9 @@ fn is_none_arm(cx: &LateContext<'_>, arm: &Arm<'_>) -> bool {
1590 1590 // Checks if arm has the form `Some(ref v) => Some(v)` (checks for `ref` and `ref mut`)
1591 1591 fn is_ref_some_arm(cx: &LateContext<'_>, arm: &Arm<'_>) -> Option<BindingAnnotation> {
1592 1592 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;
1594 1594 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;
1596 1596 if rb == BindingAnnotation::Ref |
1597 1597 if let ExprKind::Call(e, args) = remove_blocks(arm.body).kind;
1598 1598 if let ExprKind::Path(ref some_path) = e.kind;