diff --git a/clippy_lints/src/copies.rs b/clippy_lints/src/copies.rs index 504515be88c..02cd719aa97 100644 --- a/clippy_lints/src/copies.rs +++ b/clippy_lints/src/copies.rs @@ -253,7 +253,6 @@ fn bindings<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, pat: &Pat) -> HashMap (), diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index de21cabc6fb..7aac6e96508 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -202,7 +202,7 @@ fn check_single_match_opt_like(cx: &LateContext, ex: &Expr, arms: &[Arm], expr: path.to_string() } PatKind::Binding(BindByValue(MutImmutable), ident, None) => ident.node.to_string(), - PatKind::Path(ref path) => path.to_string(), + PatKind::Path(None, ref path) => path.to_string(), _ => return, }; diff --git a/clippy_lints/src/utils/hir.rs b/clippy_lints/src/utils/hir.rs index 88a9e03182c..41b82f7203b 100644 --- a/clippy_lints/src/utils/hir.rs +++ b/clippy_lints/src/utils/hir.rs @@ -148,11 +148,10 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> { (&PatKind::Binding(ref lb, ref li, ref lp), &PatKind::Binding(ref rb, ref ri, ref rp)) => { lb == rb && li.node.as_str() == ri.node.as_str() && both(lp, rp, |l, r| self.eq_pat(l, r)) } - (&PatKind::Path(ref l), &PatKind::Path(ref r)) => self.eq_path(l, r), - (&PatKind::Lit(ref l), &PatKind::Lit(ref r)) => self.eq_expr(l, r), - (&PatKind::QPath(ref ls, ref lp), &PatKind::QPath(ref rs, ref rp)) => { - self.eq_qself(ls, rs) && self.eq_path(lp, rp) + (&PatKind::Path(ref ql, ref l), &PatKind::Path(ref qr, ref r)) => { + both(ql, qr, |ql, qr| self.eq_qself(ql, qr)) && self.eq_path(l, r) } + (&PatKind::Lit(ref l), &PatKind::Lit(ref r)) => self.eq_expr(l, r), (&PatKind::Tuple(ref l, ls), &PatKind::Tuple(ref r, rs)) => { ls == rs && over(l, r, |l, r| self.eq_pat(l, r)) }