Skip to content

Commit 778ce4d

Browse files
committed
update to the rust-PR that unblocks clippy
1 parent 4a05fbb commit 778ce4d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+217
-217
lines changed

clippy_lints/src/approx_const.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ impl LintPass for Pass {
5959
}
6060
}
6161

62-
impl LateLintPass for Pass {
63-
fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
62+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
63+
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
6464
if let ExprLit(ref lit) = e.node {
6565
check_lit(cx, lit, e);
6666
}

clippy_lints/src/arithmetic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ impl LintPass for Arithmetic {
4747
}
4848
}
4949

50-
impl LateLintPass for Arithmetic {
51-
fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
50+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic {
51+
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
5252
if self.span.is_some() {
5353
return;
5454
}
@@ -82,7 +82,7 @@ impl LateLintPass for Arithmetic {
8282
}
8383
}
8484

85-
fn check_expr_post<'a, 'tcx: 'a>(&mut self, _: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
85+
fn check_expr_post(&mut self, _: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
8686
if Some(expr.span) == self.span {
8787
self.span = None;
8888
}

clippy_lints/src/array_indexing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ impl LintPass for ArrayIndexing {
5555
}
5656
}
5757

58-
impl LateLintPass for ArrayIndexing {
59-
fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
58+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ArrayIndexing {
59+
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx hir::Expr) {
6060
if let hir::ExprIndex(ref array, ref index) = e.node {
6161
// Array with known size can be checked statically
6262
let ty = cx.tcx.tables().expr_ty(array);

clippy_lints/src/assign_ops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ impl LintPass for AssignOps {
6666
}
6767
}
6868

69-
impl LateLintPass for AssignOps {
70-
fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
69+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
70+
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
7171
match expr.node {
7272
hir::ExprAssignOp(op, ref lhs, ref rhs) => {
7373
span_lint_and_then(cx, ASSIGN_OPS, expr.span, "assign operation detected", |db| {

clippy_lints/src/attrs.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ impl LintPass for AttrPass {
8181
}
8282
}
8383

84-
impl LateLintPass for AttrPass {
85-
fn check_attribute<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, attr: &'tcx Attribute) {
84+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
85+
fn check_attribute(&mut self, cx: &LateContext<'a, 'tcx>, attr: &'tcx Attribute) {
8686
if let MetaItemKind::List(ref items) = attr.value.node {
8787
if items.is_empty() || attr.name() != "deprecated" {
8888
return;
@@ -99,7 +99,7 @@ impl LateLintPass for AttrPass {
9999
}
100100
}
101101

102-
fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
102+
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
103103
if is_relevant_item(cx, item) {
104104
check_attrs(cx, item.span, &item.name, &item.attrs)
105105
}
@@ -138,13 +138,13 @@ impl LateLintPass for AttrPass {
138138
}
139139
}
140140

141-
fn check_impl_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
141+
fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx ImplItem) {
142142
if is_relevant_impl(cx, item) {
143143
check_attrs(cx, item.span, &item.name, &item.attrs)
144144
}
145145
}
146146

147-
fn check_trait_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
147+
fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
148148
if is_relevant_trait(cx, item) {
149149
check_attrs(cx, item.span, &item.name, &item.attrs)
150150
}

clippy_lints/src/bit_mask.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ impl LintPass for BitMask {
7979
}
8080
}
8181

82-
impl LateLintPass for BitMask {
83-
fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
82+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BitMask {
83+
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
8484
if let ExprBinary(ref cmp, ref left, ref right) = e.node {
8585
if cmp.node.is_comparison() {
8686
if let Some(cmp_opt) = fetch_int_literal(cx, right) {

clippy_lints/src/blacklisted_name.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ impl LintPass for BlackListedName {
3737
}
3838
}
3939

40-
impl LateLintPass for BlackListedName {
41-
fn check_pat<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
40+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlackListedName {
41+
fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
4242
if let PatKind::Binding(_, _, ref ident, _) = pat.node {
4343
if self.blacklist.iter().any(|s| s == &*ident.node.as_str()) {
4444
span_lint(cx,

clippy_lints/src/block_in_if_condition.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ const BRACED_EXPR_MESSAGE: &'static str = "omit braces around single expression
7474
const COMPLEX_BLOCK_MESSAGE: &'static str = "in an 'if' condition, avoid complex blocks or closures with blocks; \
7575
instead, move the block or closure higher and bind it with a 'let'";
7676

77-
impl LateLintPass for BlockInIfCondition {
78-
fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
77+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlockInIfCondition {
78+
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
7979
if let ExprIf(ref check, ref then, _) = expr.node {
8080
if let ExprBlock(ref block) = check.node {
8181
if block.rules == DefaultBlock {

clippy_lints/src/booleans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ impl LintPass for NonminimalBool {
5353
}
5454
}
5555

56-
impl LateLintPass for NonminimalBool {
57-
fn check_item<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
56+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonminimalBool {
57+
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
5858
NonminimalBoolVisitor { cx: cx }.visit_item(item)
5959
}
6060
}

clippy_lints/src/copies.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ impl LintPass for CopyAndPaste {
109109
}
110110
}
111111

112-
impl LateLintPass for CopyAndPaste {
113-
fn check_expr<'a, 'tcx: 'a>(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
112+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CopyAndPaste {
113+
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
114114
if !in_macro(cx, expr.span) {
115115
// skip ifs directly in else, it will be checked in the parent if
116116
if let Some(&Expr { node: ExprIf(_, _, Some(ref else_expr)), .. }) = get_parent_expr(cx, expr) {

0 commit comments

Comments
 (0)