Skip to content

Commit 53cb7b0

Browse files
committed
Auto merge of #86390 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
[stable] 1.53.0 release - backport This hopefully fixes a Clippy ICE on rustc std and the crates.io codebase (and potentially others). r? `@Mark-Simulacrum`
2 parents dbe03e2 + 8e78f4a commit 53cb7b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)