summary refs log tree commit diff
path: root/src/tools/clippy/clippy_lints
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-06-17 03:53:17 +0000
committerbors <bors@rust-lang.org>2021-06-17 03:53:17 +0000
commit53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b (patch)
tree4b4474b40f74d854823fbfc5f8a7cbf79ee0a7fb /src/tools/clippy/clippy_lints
parentdbe03e256bc27420c34ab146b3d3859be0b69967 (diff)
parent8e78f4a03f89ebb9da42cb74a4f3acf0ce7d4ea5 (diff)
downloadrust-1.53.0.tar.gz
rust-1.53.0.zip
Auto merge of #86390 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum 1.53.0
[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`
Diffstat (limited to 'src/tools/clippy/clippy_lints')
-rw-r--r--src/tools/clippy/clippy_lints/src/matches.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/clippy/clippy_lints/src/matches.rs b/src/tools/clippy/clippy_lints/src/matches.rs
index 50e2898bdaa..a70e8b26087 100644
--- a/src/tools/clippy/clippy_lints/src/matches.rs
+++ b/src/tools/clippy/clippy_lints/src/matches.rs
@@ -1590,9 +1590,9 @@ fn is_none_arm(cx: &LateContext<'_>, arm: &Arm<'_>) -> bool {
 // Checks if arm has the form `Some(ref v) => Some(v)` (checks for `ref` and `ref mut`)
 fn is_ref_some_arm(cx: &LateContext<'_>, arm: &Arm<'_>) -> Option<BindingAnnotation> {
     if_chain! {
-        if let PatKind::TupleStruct(ref qpath, pats, _) = arm.pat.kind;
+        if let PatKind::TupleStruct(ref qpath, [first_pat, ..], _) = arm.pat.kind;
         if is_lang_ctor(cx, qpath, OptionSome);
-        if let PatKind::Binding(rb, .., ident, _) = pats[0].kind;
+        if let PatKind::Binding(rb, .., ident, _) = first_pat.kind;
         if rb == BindingAnnotation::Ref || rb == BindingAnnotation::RefMut;
         if let ExprKind::Call(e, args) = remove_blocks(arm.body).kind;
         if let ExprKind::Path(ref some_path) = e.kind;