Skip to content

Commit 5f0f64c

Browse files
committed
Merge pull request #970 from Manishearth/rustup
s/PatKind::Ident/PatKind::Binding/g
2 parents 762aff2 + 5c51a24 commit 5f0f64c

File tree

17 files changed

+35
-21
lines changed

17 files changed

+35
-21
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4-
## 0.0.71 — TBD
4+
## 0.0.71 — 2016-05-31
5+
* Rustup to *rustc 1.10.0-nightly (7bddce693 2016-05-27)*
56
* New lint: [`useless_let_if_seq`]
67

78
## 0.0.70 — 2016-05-28

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.0.70"
3+
version = "0.0.71"
44
authors = [
55
"Manish Goregaokar <manishsmail@gmail.com>",
66
"Andre Bogus <bogusandre@gmail.com>",
@@ -30,7 +30,7 @@ toml = "0.1"
3030
unicode-normalization = "0.1"
3131
quine-mc_cluskey = "0.2.2"
3232
# begin automatic update
33-
clippy_lints = { version = "0.0.70", path = "clippy_lints" }
33+
clippy_lints = { version = "0.0.71", path = "clippy_lints" }
3434
# end automatic update
3535
rustc-serialize = "0.3"
3636

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_lints"
33
# begin automatic update
4-
version = "0.0.70"
4+
version = "0.0.71"
55
# end automatic update
66
authors = [
77
"Manish Goregaokar <manishsmail@gmail.com>",

clippy_lints/src/blacklisted_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl LintPass for BlackListedName {
3434

3535
impl LateLintPass for BlackListedName {
3636
fn check_pat(&mut self, cx: &LateContext, pat: &Pat) {
37-
if let PatKind::Ident(_, ref ident, _) = pat.node {
37+
if let PatKind::Binding(_, ref ident, _) = pat.node {
3838
if self.blacklist.iter().any(|s| s == &*ident.node.as_str()) {
3939
span_lint(cx,
4040
BLACKLISTED_NAME,

clippy_lints/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
345345
(BiDiv, Constant::Int(l), Some(Constant::Int(r))) => (l / r).ok().map(Constant::Int),
346346
(BiRem, Constant::Int(l), Some(Constant::Int(r))) => (l % r).ok().map(Constant::Int),
347347
(BiAnd, Constant::Bool(false), _) => Some(Constant::Bool(false)),
348-
(BiAnd, Constant::Bool(true), Some(r)) => Some(r),
349348
(BiOr, Constant::Bool(true), _) => Some(Constant::Bool(true)),
349+
(BiAnd, Constant::Bool(true), Some(r)) |
350350
(BiOr, Constant::Bool(false), Some(r)) => Some(r),
351351
(BiBitXor, Constant::Bool(l), Some(Constant::Bool(r))) => Some(Constant::Bool(l ^ r)),
352352
(BiBitXor, Constant::Int(l), Some(Constant::Int(r))) => (l ^ r).ok().map(Constant::Int),

clippy_lints/src/copies.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ fn bindings<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, pat: &Pat) -> HashMap<Interned
192192
bindings_impl(cx, pat, map);
193193
}
194194
}
195-
PatKind::Ident(_, ref ident, ref as_pat) => {
195+
PatKind::Binding(_, ref ident, ref as_pat) => {
196196
if let Entry::Vacant(v) = map.entry(ident.node.as_str()) {
197197
v.insert(cx.tcx.pat_ty(pat));
198198
}

clippy_lints/src/eta_reduction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn check_closure(cx: &LateContext, expr: &Expr) {
7070
_ => (),
7171
}
7272
for (ref a1, ref a2) in decl.inputs.iter().zip(args) {
73-
if let PatKind::Ident(_, ident, _) = a1.pat.node {
73+
if let PatKind::Binding(_, ident, _) = a1.pat.node {
7474
// XXXManishearth Should I be checking the binding mode here?
7575
if let ExprPath(None, ref p) = a2.node {
7676
if p.segments.len() != 1 {

clippy_lints/src/let_if_seq.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl LateLintPass for LetIfSeq {
6565
let Some(expr) = it.peek(),
6666
let hir::StmtDecl(ref decl, _) = stmt.node,
6767
let hir::DeclLocal(ref decl) = decl.node,
68-
let hir::PatKind::Ident(mode, ref name, None) = decl.pat.node,
68+
let hir::PatKind::Binding(mode, ref name, None) = decl.pat.node,
6969
let Some(def) = cx.tcx.def_map.borrow().get(&decl.pat.id),
7070
let hir::StmtExpr(ref if_, _) = expr.node,
7171
let hir::ExprIf(ref cond, ref then, ref else_) = if_.node,

clippy_lints/src/loops.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ fn check_for_loop(cx: &LateContext, pat: &Pat, arg: &Expr, body: &Expr, expr: &E
330330
fn check_for_loop_range(cx: &LateContext, pat: &Pat, arg: &Expr, body: &Expr, expr: &Expr) {
331331
if let Some(UnsugaredRange { start: Some(ref start), ref end, .. }) = unsugar_range(arg) {
332332
// the var must be a single name
333-
if let PatKind::Ident(_, ref ident, _) = pat.node {
333+
if let PatKind::Binding(_, ref ident, _) = pat.node {
334334
let mut visitor = VarVisitor {
335335
cx: cx,
336336
var: ident.node,
@@ -613,7 +613,7 @@ fn check_for_loop_over_map_kv(cx: &LateContext, pat: &Pat, arg: &Expr, body: &Ex
613613
fn pat_is_wild(pat: &PatKind, body: &Expr) -> bool {
614614
match *pat {
615615
PatKind::Wild => true,
616-
PatKind::Ident(_, ident, None) if ident.node.as_str().starts_with('_') => {
616+
PatKind::Binding(_, ident, None) if ident.node.as_str().starts_with('_') => {
617617
let mut visitor = UsedVisitor {
618618
var: ident.node,
619619
used: false,
@@ -884,7 +884,7 @@ impl<'v, 't> Visitor<'v> for InitializeVisitor<'v, 't> {
884884
// Look for declarations of the variable
885885
if let DeclLocal(ref local) = decl.node {
886886
if local.pat.id == self.var_id {
887-
if let PatKind::Ident(_, ref ident, _) = local.pat.node {
887+
if let PatKind::Binding(_, ref ident, _) = local.pat.node {
888888
self.name = Some(ident.node);
889889

890890
self.state = if let Some(ref init) = local.init {

clippy_lints/src/map_clone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fn get_type_name(cx: &LateContext, expr: &Expr, arg: &Expr) -> Option<&'static s
108108

109109
fn get_arg_name(pat: &Pat) -> Option<ast::Name> {
110110
match pat.node {
111-
PatKind::Ident(_, name, None) => Some(name.node),
111+
PatKind::Binding(_, name, None) => Some(name.node),
112112
PatKind::Ref(ref subpat, _) => get_arg_name(subpat),
113113
_ => None,
114114
}

0 commit comments

Comments
 (0)