Skip to content

Commit 0afa5e1

Browse files
committed
Merge branch 'master' into allow-pass-by-ref-on-ref-return
2 parents 7c74c3e + 25e0a08 commit 0afa5e1

Some content is hidden

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

93 files changed

+551
-659
lines changed

clippy_lints/src/approx_const.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
7070
}
7171
}
7272

73-
fn check_lit(cx: &LateContext, lit: &Lit, e: &Expr) {
73+
fn check_lit(cx: &LateContext<'_, '_>, lit: &Lit, e: &Expr) {
7474
match lit.node {
7575
LitKind::Float(s, FloatTy::F32) => check_known_consts(cx, e, s, "f32"),
7676
LitKind::Float(s, FloatTy::F64) => check_known_consts(cx, e, s, "f64"),
@@ -79,7 +79,7 @@ fn check_lit(cx: &LateContext, lit: &Lit, e: &Expr) {
7979
}
8080
}
8181

82-
fn check_known_consts(cx: &LateContext, e: &Expr, s: symbol::Symbol, module: &str) {
82+
fn check_known_consts(cx: &LateContext<'_, '_>, e: &Expr, s: symbol::Symbol, module: &str) {
8383
let s = s.as_str();
8484
if s.parse::<f64>().is_ok() {
8585
for &(constant, name, min_digits) in KNOWN_CONSTS {

clippy_lints/src/attrs.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,22 +226,22 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
226226
}
227227
}
228228

229-
fn is_relevant_item(tcx: TyCtxt, item: &Item) -> bool {
229+
fn is_relevant_item(tcx: TyCtxt<'_, '_, '_>, item: &Item) -> bool {
230230
if let ItemKind::Fn(_, _, _, eid) = item.node {
231231
is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir.body(eid).value)
232232
} else {
233233
true
234234
}
235235
}
236236

237-
fn is_relevant_impl(tcx: TyCtxt, item: &ImplItem) -> bool {
237+
fn is_relevant_impl(tcx: TyCtxt<'_, '_, '_>, item: &ImplItem) -> bool {
238238
match item.node {
239239
ImplItemKind::Method(_, eid) => is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir.body(eid).value),
240240
_ => false,
241241
}
242242
}
243243

244-
fn is_relevant_trait(tcx: TyCtxt, item: &TraitItem) -> bool {
244+
fn is_relevant_trait(tcx: TyCtxt<'_, '_, '_>, item: &TraitItem) -> bool {
245245
match item.node {
246246
TraitItemKind::Method(_, TraitMethod::Required(_)) => true,
247247
TraitItemKind::Method(_, TraitMethod::Provided(eid)) => {
@@ -251,7 +251,7 @@ fn is_relevant_trait(tcx: TyCtxt, item: &TraitItem) -> bool {
251251
}
252252
}
253253

254-
fn is_relevant_block(tcx: TyCtxt, tables: &ty::TypeckTables, block: &Block) -> bool {
254+
fn is_relevant_block(tcx: TyCtxt<'_, '_, '_>, tables: &ty::TypeckTables<'_>, block: &Block) -> bool {
255255
if let Some(stmt) = block.stmts.first() {
256256
match stmt.node {
257257
StmtKind::Decl(_, _) => true,
@@ -262,7 +262,7 @@ fn is_relevant_block(tcx: TyCtxt, tables: &ty::TypeckTables, block: &Block) -> b
262262
}
263263
}
264264

265-
fn is_relevant_expr(tcx: TyCtxt, tables: &ty::TypeckTables, expr: &Expr) -> bool {
265+
fn is_relevant_expr(tcx: TyCtxt<'_, '_, '_>, tables: &ty::TypeckTables<'_>, expr: &Expr) -> bool {
266266
match expr.node {
267267
ExprKind::Block(ref block, _) => is_relevant_block(tcx, tables, block),
268268
ExprKind::Ret(Some(ref e)) => is_relevant_expr(tcx, tables, e),
@@ -280,7 +280,7 @@ fn is_relevant_expr(tcx: TyCtxt, tables: &ty::TypeckTables, expr: &Expr) -> bool
280280
}
281281
}
282282

283-
fn check_attrs(cx: &LateContext, span: Span, name: Name, attrs: &[Attribute]) {
283+
fn check_attrs(cx: &LateContext<'_, '_>, span: Span, name: Name, attrs: &[Attribute]) {
284284
if in_macro(span) {
285285
return;
286286
}
@@ -331,7 +331,7 @@ fn check_attrs(cx: &LateContext, span: Span, name: Name, attrs: &[Attribute]) {
331331
}
332332
}
333333

334-
fn check_semver(cx: &LateContext, span: Span, lit: &Lit) {
334+
fn check_semver(cx: &LateContext<'_, '_>, span: Span, lit: &Lit) {
335335
if let LitKind::Str(ref is, _) = lit.node {
336336
if Version::parse(&is.as_str()).is_ok() {
337337
return;
@@ -358,7 +358,7 @@ fn is_word(nmi: &NestedMetaItem, expected: &str) -> bool {
358358
// sources that the user has no control over.
359359
// For some reason these attributes don't have any expansion info on them, so
360360
// we have to check it this way until there is a better way.
361-
fn is_present_in_source(cx: &LateContext, span: Span) -> bool {
361+
fn is_present_in_source(cx: &LateContext<'_, '_>, span: Span) -> bool {
362362
if let Some(snippet) = snippet_opt(cx, span) {
363363
if snippet.is_empty() {
364364
return false;

clippy_lints/src/bit_mask.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ fn invert_cmp(cmp: BinOpKind) -> BinOpKind {
158158
}
159159

160160

161-
fn check_compare(cx: &LateContext, bit_op: &Expr, cmp_op: BinOpKind, cmp_value: u128, span: Span) {
161+
fn check_compare(cx: &LateContext<'_, '_>, bit_op: &Expr, cmp_op: BinOpKind, cmp_value: u128, span: Span) {
162162
if let ExprKind::Binary(ref op, ref left, ref right) = bit_op.node {
163163
if op.node != BinOpKind::BitAnd && op.node != BinOpKind::BitOr {
164164
return;
@@ -169,7 +169,7 @@ fn check_compare(cx: &LateContext, bit_op: &Expr, cmp_op: BinOpKind, cmp_value:
169169
}
170170
}
171171

172-
fn check_bit_mask(cx: &LateContext, bit_op: BinOpKind, cmp_op: BinOpKind, mask_value: u128, cmp_value: u128, span: Span) {
172+
fn check_bit_mask(cx: &LateContext<'_, '_>, bit_op: BinOpKind, cmp_op: BinOpKind, mask_value: u128, cmp_value: u128, span: Span) {
173173
match cmp_op {
174174
BinOpKind::Eq | BinOpKind::Ne => match bit_op {
175175
BinOpKind::BitAnd => if mask_value & cmp_value != cmp_value {
@@ -270,7 +270,7 @@ fn check_bit_mask(cx: &LateContext, bit_op: BinOpKind, cmp_op: BinOpKind, mask_v
270270
}
271271
}
272272

273-
fn check_ineffective_lt(cx: &LateContext, span: Span, m: u128, c: u128, op: &str) {
273+
fn check_ineffective_lt(cx: &LateContext<'_, '_>, span: Span, m: u128, c: u128, op: &str) {
274274
if c.is_power_of_two() && m < c {
275275
span_lint(
276276
cx,
@@ -286,7 +286,7 @@ fn check_ineffective_lt(cx: &LateContext, span: Span, m: u128, c: u128, op: &str
286286
}
287287
}
288288

289-
fn check_ineffective_gt(cx: &LateContext, span: Span, m: u128, c: u128, op: &str) {
289+
fn check_ineffective_gt(cx: &LateContext<'_, '_>, span: Span, m: u128, c: u128, op: &str) {
290290
if (c + 1).is_power_of_two() && m <= c {
291291
span_lint(
292292
cx,
@@ -302,7 +302,7 @@ fn check_ineffective_gt(cx: &LateContext, span: Span, m: u128, c: u128, op: &str
302302
}
303303
}
304304

305-
fn fetch_int_literal(cx: &LateContext, lit: &Expr) -> Option<u128> {
305+
fn fetch_int_literal(cx: &LateContext<'_, '_>, lit: &Expr) -> Option<u128> {
306306
match constant(cx, cx.tables, lit)?.0 {
307307
Constant::Int(n) => Some(n),
308308
_ => None,

clippy_lints/src/booleans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ impl<'a, 'tcx, 'v> SuggestContext<'a, 'tcx, 'v> {
275275
}
276276

277277
// The boolean part of the return indicates whether some simplifications have been applied.
278-
fn suggest(cx: &LateContext, suggestion: &Bool, terminals: &[&Expr]) -> (String, bool) {
278+
fn suggest(cx: &LateContext<'_, '_>, suggestion: &Bool, terminals: &[&Expr]) -> (String, bool) {
279279
let mut suggest_context = SuggestContext {
280280
terminals,
281281
cx,

clippy_lints/src/bytecount.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl LintPass for ByteCount {
3838
}
3939

4040
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ByteCount {
41-
fn check_expr(&mut self, cx: &LateContext, expr: &Expr) {
41+
fn check_expr(&mut self, cx: &LateContext<'_, '_>, expr: &Expr) {
4242
if_chain! {
4343
if let ExprKind::MethodCall(ref count, _, ref count_args) = expr.node;
4444
if count.ident.name == "count";

clippy_lints/src/collapsible_if.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ impl LintPass for CollapsibleIf {
8080
}
8181

8282
impl EarlyLintPass for CollapsibleIf {
83-
fn check_expr(&mut self, cx: &EarlyContext, expr: &ast::Expr) {
83+
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &ast::Expr) {
8484
if !in_macro(expr.span) {
8585
check_if(cx, expr)
8686
}
8787
}
8888
}
8989

90-
fn check_if(cx: &EarlyContext, expr: &ast::Expr) {
90+
fn check_if(cx: &EarlyContext<'_>, expr: &ast::Expr) {
9191
match expr.node {
9292
ast::ExprKind::If(ref check, ref then, ref else_) => if let Some(ref else_) = *else_ {
9393
check_collapsible_maybe_if_let(cx, else_);
@@ -101,7 +101,7 @@ fn check_if(cx: &EarlyContext, expr: &ast::Expr) {
101101
}
102102
}
103103

104-
fn check_collapsible_maybe_if_let(cx: &EarlyContext, else_: &ast::Expr) {
104+
fn check_collapsible_maybe_if_let(cx: &EarlyContext<'_>, else_: &ast::Expr) {
105105
if_chain! {
106106
if let ast::ExprKind::Block(ref block, _) = else_.node;
107107
if let Some(else_) = expr_block(block);
@@ -122,7 +122,7 @@ fn check_collapsible_maybe_if_let(cx: &EarlyContext, else_: &ast::Expr) {
122122
}
123123
}
124124

125-
fn check_collapsible_no_if_let(cx: &EarlyContext, expr: &ast::Expr, check: &ast::Expr, then: &ast::Block) {
125+
fn check_collapsible_no_if_let(cx: &EarlyContext<'_>, expr: &ast::Expr, check: &ast::Expr, then: &ast::Block) {
126126
if_chain! {
127127
if let Some(inner) = expr_block(then);
128128
if let ast::ExprKind::If(ref check_inner, ref content, None) = inner.node;

clippy_lints/src/const_static_lifetime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl LintPass for StaticConst {
3535

3636
impl StaticConst {
3737
// Recursively visit types
38-
fn visit_type(&mut self, ty: &Ty, cx: &EarlyContext) {
38+
fn visit_type(&mut self, ty: &Ty, cx: &EarlyContext<'_>) {
3939
match ty.node {
4040
// Be careful of nested structures (arrays and tuples)
4141
TyKind::Array(ref ty, _) => {
@@ -79,7 +79,7 @@ impl StaticConst {
7979
}
8080

8181
impl EarlyLintPass for StaticConst {
82-
fn check_item(&mut self, cx: &EarlyContext, item: &Item) {
82+
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
8383
if !in_macro(item.span) {
8484
// Match only constants...
8585
if let ItemKind::Const(ref var_type, _) = item.node {

clippy_lints/src/consts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl Hash for Constant {
123123
}
124124

125125
impl Constant {
126-
pub fn partial_cmp(tcx: TyCtxt, cmp_type: &ty::TypeVariants, left: &Self, right: &Self) -> Option<Ordering> {
126+
pub fn partial_cmp(tcx: TyCtxt<'_, '_, '_>, cmp_type: &ty::TypeVariants<'_>, left: &Self, right: &Self) -> Option<Ordering> {
127127
match (left, right) {
128128
(&Constant::Str(ref ls), &Constant::Str(ref rs)) => Some(ls.cmp(rs)),
129129
(&Constant::Char(ref l), &Constant::Char(ref r)) => Some(l.cmp(r)),
@@ -236,7 +236,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
236236
}
237237
}
238238

239-
fn constant_not(&self, o: &Constant, ty: ty::Ty) -> Option<Constant> {
239+
fn constant_not(&self, o: &Constant, ty: ty::Ty<'_>) -> Option<Constant> {
240240
use self::Constant::*;
241241
match *o {
242242
Bool(b) => Some(Bool(!b)),
@@ -252,7 +252,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
252252
}
253253
}
254254

255-
fn constant_negate(&self, o: &Constant, ty: ty::Ty) -> Option<Constant> {
255+
fn constant_negate(&self, o: &Constant, ty: ty::Ty<'_>) -> Option<Constant> {
256256
use self::Constant::*;
257257
match *o {
258258
Int(value) => {

clippy_lints/src/copies.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CopyAndPaste {
134134
}
135135

136136
/// Implementation of `IF_SAME_THEN_ELSE`.
137-
fn lint_same_then_else(cx: &LateContext, blocks: &[&Block]) {
137+
fn lint_same_then_else(cx: &LateContext<'_, '_>, blocks: &[&Block]) {
138138
let eq: &dyn Fn(&&Block, &&Block) -> bool = &|&lhs, &rhs| -> bool { SpanlessEq::new(cx).eq_block(lhs, rhs) };
139139

140140
if let Some((i, j)) = search_same_sequenced(blocks, eq) {
@@ -150,7 +150,7 @@ fn lint_same_then_else(cx: &LateContext, blocks: &[&Block]) {
150150
}
151151

152152
/// Implementation of `IFS_SAME_COND`.
153-
fn lint_same_cond(cx: &LateContext, conds: &[&Expr]) {
153+
fn lint_same_cond(cx: &LateContext<'_, '_>, conds: &[&Expr]) {
154154
let hash: &dyn Fn(&&Expr) -> u64 = &|expr| -> u64 {
155155
let mut h = SpanlessHash::new(cx, cx.tables);
156156
h.hash_expr(expr);
@@ -172,7 +172,7 @@ fn lint_same_cond(cx: &LateContext, conds: &[&Expr]) {
172172
}
173173

174174
/// Implementation of `MATCH_SAME_ARMS`.
175-
fn lint_match_arms(cx: &LateContext, expr: &Expr) {
175+
fn lint_match_arms(cx: &LateContext<'_, '_>, expr: &Expr) {
176176
if let ExprKind::Match(_, ref arms, MatchSource::Normal) = expr.node {
177177
let hash = |&(_, arm): &(usize, &Arm)| -> u64 {
178178
let mut h = SpanlessHash::new(cx, cx.tables);

clippy_lints/src/cyclomatic_complexity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CCHelper<'a, 'tcx> {
187187

188188
#[cfg(feature = "debugging")]
189189
#[allow(too_many_arguments)]
190-
fn report_cc_bug(_: &LateContext, cc: u64, narms: u64, div: u64, shorts: u64, returns: u64, span: Span, _: NodeId) {
190+
fn report_cc_bug(_: &LateContext<'_, '_>, cc: u64, narms: u64, div: u64, shorts: u64, returns: u64, span: Span, _: NodeId) {
191191
span_bug!(
192192
span,
193193
"Clippy encountered a bug calculating cyclomatic complexity: cc = {}, arms = {}, \
@@ -201,7 +201,7 @@ fn report_cc_bug(_: &LateContext, cc: u64, narms: u64, div: u64, shorts: u64, re
201201
}
202202
#[cfg(not(feature = "debugging"))]
203203
#[allow(too_many_arguments)]
204-
fn report_cc_bug(cx: &LateContext, cc: u64, narms: u64, div: u64, shorts: u64, returns: u64, span: Span, id: NodeId) {
204+
fn report_cc_bug(cx: &LateContext<'_, '_>, cc: u64, narms: u64, div: u64, shorts: u64, returns: u64, span: Span, id: NodeId) {
205205
if !is_allowed(cx, CYCLOMATIC_COMPLEXITY, id) {
206206
cx.sess().span_note_without_error(
207207
span,

clippy_lints/src/doc.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ impl LintPass for Doc {
5252
}
5353

5454
impl EarlyLintPass for Doc {
55-
fn check_crate(&mut self, cx: &EarlyContext, krate: &ast::Crate) {
55+
fn check_crate(&mut self, cx: &EarlyContext<'_>, krate: &ast::Crate) {
5656
check_attrs(cx, &self.valid_idents, &krate.attrs);
5757
}
5858

59-
fn check_item(&mut self, cx: &EarlyContext, item: &ast::Item) {
59+
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &ast::Item) {
6060
check_attrs(cx, &self.valid_idents, &item.attrs);
6161
}
6262
}
@@ -139,7 +139,7 @@ pub fn strip_doc_comment_decoration(comment: &str, span: Span) -> (String, Vec<(
139139
panic!("not a doc-comment: {}", comment);
140140
}
141141

142-
pub fn check_attrs<'a>(cx: &EarlyContext, valid_idents: &[String], attrs: &'a [ast::Attribute]) {
142+
pub fn check_attrs<'a>(cx: &EarlyContext<'_>, valid_idents: &[String], attrs: &'a [ast::Attribute]) {
143143
let mut doc = String::new();
144144
let mut spans = vec![];
145145

@@ -186,7 +186,7 @@ pub fn check_attrs<'a>(cx: &EarlyContext, valid_idents: &[String], attrs: &'a [a
186186
}
187187

188188
fn check_doc<'a, Events: Iterator<Item = (usize, pulldown_cmark::Event<'a>)>>(
189-
cx: &EarlyContext,
189+
cx: &EarlyContext<'_>,
190190
valid_idents: &[String],
191191
docs: Events,
192192
spans: &[(usize, Span)],
@@ -232,7 +232,7 @@ fn check_doc<'a, Events: Iterator<Item = (usize, pulldown_cmark::Event<'a>)>>(
232232
}
233233
}
234234

235-
fn check_text(cx: &EarlyContext, valid_idents: &[String], text: &str, span: Span) {
235+
fn check_text(cx: &EarlyContext<'_>, valid_idents: &[String], text: &str, span: Span) {
236236
for word in text.split_whitespace() {
237237
// Trim punctuation as in `some comment (see foo::bar).`
238238
// ^^
@@ -255,7 +255,7 @@ fn check_text(cx: &EarlyContext, valid_idents: &[String], text: &str, span: Span
255255
}
256256
}
257257

258-
fn check_word(cx: &EarlyContext, word: &str, span: Span) {
258+
fn check_word(cx: &EarlyContext<'_>, word: &str, span: Span) {
259259
/// Checks if a string is camel-case, ie. contains at least two uppercase
260260
/// letter (`Clippy` is
261261
/// ok) and one lower-case letter (`NASA` is ok). Plural are also excluded

clippy_lints/src/double_parens.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl LintPass for DoubleParens {
3131
}
3232

3333
impl EarlyLintPass for DoubleParens {
34-
fn check_expr(&mut self, cx: &EarlyContext, expr: &Expr) {
34+
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
3535
match expr.node {
3636
ExprKind::Paren(ref in_paren) => match in_paren.node {
3737
ExprKind::Paren(_) | ExprKind::Tup(_) => {

clippy_lints/src/else_if_without_else.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl LintPass for ElseIfWithoutElse {
4949
}
5050

5151
impl EarlyLintPass for ElseIfWithoutElse {
52-
fn check_expr(&mut self, cx: &EarlyContext, mut item: &Expr) {
52+
fn check_expr(&mut self, cx: &EarlyContext<'_>, mut item: &Expr) {
5353
if in_external_macro(cx, item.span) {
5454
return;
5555
}

clippy_lints/src/empty_enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl LintPass for EmptyEnum {
3333
}
3434

3535
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EmptyEnum {
36-
fn check_item(&mut self, cx: &LateContext, item: &Item) {
36+
fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &Item) {
3737
let did = cx.tcx.hir.local_def_id(item.id);
3838
if let ItemKind::Enum(..) = item.node {
3939
let ty = cx.tcx.type_of(did);

clippy_lints/src/enum_glob_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EnumGlobUse {
4444
}
4545

4646
impl EnumGlobUse {
47-
fn lint_item(&self, cx: &LateContext, item: &Item) {
47+
fn lint_item(&self, cx: &LateContext<'_, '_>, item: &Item) {
4848
if item.vis.node.is_pub() {
4949
return; // re-exports are fine
5050
}

clippy_lints/src/enum_variants.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fn partial_rmatch(post: &str, name: &str) -> usize {
149149
// FIXME: #600
150150
#[allow(while_let_on_iterator)]
151151
fn check_variant(
152-
cx: &EarlyContext,
152+
cx: &EarlyContext<'_>,
153153
threshold: u64,
154154
def: &EnumDef,
155155
item_name: &str,
@@ -240,12 +240,12 @@ fn to_camel_case(item_name: &str) -> String {
240240
}
241241

242242
impl EarlyLintPass for EnumVariantNames {
243-
fn check_item_post(&mut self, _cx: &EarlyContext, _item: &Item) {
243+
fn check_item_post(&mut self, _cx: &EarlyContext<'_>, _item: &Item) {
244244
let last = self.modules.pop();
245245
assert!(last.is_some());
246246
}
247247

248-
fn check_item(&mut self, cx: &EarlyContext, item: &Item) {
248+
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
249249
let item_name = item.ident.as_str();
250250
let item_name_chars = item_name.chars().count();
251251
let item_camel = to_camel_case(&item_name);

clippy_lints/src/erasing_op.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ErasingOp {
5050
}
5151
}
5252

53-
fn check(cx: &LateContext, e: &Expr, span: Span) {
53+
fn check(cx: &LateContext<'_, '_>, e: &Expr, span: Span) {
5454
if let Some(Constant::Int(v)) = constant_simple(cx, cx.tables, e) {
5555
if v == 0 {
5656
span_lint(

0 commit comments

Comments
 (0)