mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
added missing PatKind::Path + tests
This commit is contained in:
parent
e18dc948c7
commit
2811dd64ec
@ -201,6 +201,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(),
|
||||
_ => return,
|
||||
};
|
||||
|
||||
|
@ -148,6 +148,7 @@ 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)
|
||||
|
@ -216,6 +216,12 @@ fn overlapping() {
|
||||
11 ... 50 => println!("0 ... 10"),
|
||||
_ => (),
|
||||
}
|
||||
|
||||
if let None = Some(42) {
|
||||
// nothing
|
||||
} else if let None = Some(42) {
|
||||
// another nothing :-)
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Loading…
Reference in New Issue
Block a user