Skip to content

Commit 10b7fab

Browse files
committed
Fix adjacent code
1 parent e9216d8 commit 10b7fab

Some content is hidden

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

43 files changed

+74
-78
lines changed

clippy_lints/src/booleans.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> {
481481
}
482482
}
483483

484-
fn implements_ord<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>) -> bool {
484+
fn implements_ord(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
485485
let ty = cx.typeck_results().expr_ty(expr);
486486
cx.tcx
487487
.get_diagnostic_item(sym::Ord)

clippy_lints/src/dereference.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1231,8 +1231,8 @@ fn is_mixed_projection_predicate<'tcx>(
12311231
}
12321232
}
12331233

1234-
fn referent_used_exactly_once<'a, 'tcx>(
1235-
cx: &'a LateContext<'tcx>,
1234+
fn referent_used_exactly_once<'tcx>(
1235+
cx: &LateContext<'tcx>,
12361236
possible_borrowers: &mut Vec<(LocalDefId, PossibleBorrowerMap<'tcx, 'tcx>)>,
12371237
reference: &Expr<'tcx>,
12381238
) -> bool {

clippy_lints/src/doc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ impl<'tcx> LateLintPass<'tcx> for DocMarkdown {
336336
}
337337
}
338338

339-
fn lint_for_missing_headers<'tcx>(
340-
cx: &LateContext<'tcx>,
339+
fn lint_for_missing_headers(
340+
cx: &LateContext<'_>,
341341
def_id: LocalDefId,
342342
span: impl Into<MultiSpan> + Copy,
343343
sig: &hir::FnSig<'_>,
@@ -467,7 +467,7 @@ struct DocHeaders {
467467
panics: bool,
468468
}
469469

470-
fn check_attrs<'a>(cx: &LateContext<'_>, valid_idents: &FxHashSet<String>, attrs: &'a [Attribute]) -> DocHeaders {
470+
fn check_attrs(cx: &LateContext<'_>, valid_idents: &FxHashSet<String>, attrs: &[Attribute]) -> DocHeaders {
471471
use pulldown_cmark::{BrokenLink, CowStr, Options};
472472
/// We don't want the parser to choke on intra doc links. Since we don't
473473
/// actually care about rendering them, just pretend that all broken links are

clippy_lints/src/fallible_impl_from.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'tcx> LateLintPass<'tcx> for FallibleImplFrom {
6464
}
6565
}
6666

67-
fn lint_impl_body<'tcx>(cx: &LateContext<'tcx>, impl_span: Span, impl_items: &[hir::ImplItemRef]) {
67+
fn lint_impl_body(cx: &LateContext<'_>, impl_span: Span, impl_items: &[hir::ImplItemRef]) {
6868
use rustc_hir::intravisit::{self, Visitor};
6969
use rustc_hir::{Expr, ImplItemKind};
7070

clippy_lints/src/implicit_hasher.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitHasher {
6666
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
6767
use rustc_span::BytePos;
6868

69-
fn suggestion<'tcx>(
70-
cx: &LateContext<'tcx>,
69+
fn suggestion(
70+
cx: &LateContext<'_>,
7171
diag: &mut Diagnostic,
7272
generics_span: Span,
7373
generics_suggestion_span: Span,

clippy_lints/src/index_refutable_slice.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ impl SliceLintInformation {
207207
}
208208
}
209209

210-
fn filter_lintable_slices<'a, 'tcx>(
211-
cx: &'a LateContext<'tcx>,
210+
fn filter_lintable_slices<'tcx>(
211+
cx: &LateContext<'tcx>,
212212
slice_lint_info: FxIndexMap<hir::HirId, SliceLintInformation>,
213213
max_suggested_slice: u64,
214214
scope: &'tcx hir::Expr<'tcx>,

clippy_lints/src/indexing_slicing.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,7 @@ impl<'tcx> LateLintPass<'tcx> for IndexingSlicing {
171171

172172
/// Returns a tuple of options with the start and end (exclusive) values of
173173
/// the range. If the start or end is not constant, None is returned.
174-
fn to_const_range<'tcx>(
175-
cx: &LateContext<'tcx>,
176-
range: higher::Range<'_>,
177-
array_size: u128,
178-
) -> (Option<u128>, Option<u128>) {
174+
fn to_const_range(cx: &LateContext<'_>, range: higher::Range<'_>, array_size: u128) -> (Option<u128>, Option<u128>) {
179175
let s = range
180176
.start
181177
.map(|expr| constant(cx, cx.typeck_results(), expr).map(|(c, _)| c));

clippy_lints/src/invalid_upcast_comparisons.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ declare_clippy_lint! {
3838

3939
declare_lint_pass!(InvalidUpcastComparisons => [INVALID_UPCAST_COMPARISONS]);
4040

41-
fn numeric_cast_precast_bounds<'a>(cx: &LateContext<'_>, expr: &'a Expr<'_>) -> Option<(FullInt, FullInt)> {
41+
fn numeric_cast_precast_bounds(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<(FullInt, FullInt)> {
4242
if let ExprKind::Cast(cast_exp, _) = expr.kind {
4343
let pre_cast_ty = cx.typeck_results().expr_ty(cast_exp);
4444
let cast_ty = cx.typeck_results().expr_ty(expr);

clippy_lints/src/loops/mut_range_bound.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ fn check_for_mutability(cx: &LateContext<'_>, bound: &Expr<'_>) -> Option<HirId>
5252
None
5353
}
5454

55-
fn check_for_mutation<'tcx>(
56-
cx: &LateContext<'tcx>,
55+
fn check_for_mutation(
56+
cx: &LateContext<'_>,
5757
body: &Expr<'_>,
5858
bound_id_start: Option<HirId>,
5959
bound_id_end: Option<HirId>,

clippy_lints/src/map_unit_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fn is_unit_expression(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> bool {
119119
/// semicolons, which causes problems when generating a suggestion. Given an
120120
/// expression that evaluates to '()' or '!', recursively remove useless braces
121121
/// and semi-colons until is suitable for including in the suggestion template
122-
fn reduce_unit_expression<'a>(cx: &LateContext<'_>, expr: &'a hir::Expr<'_>) -> Option<Span> {
122+
fn reduce_unit_expression(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> Option<Span> {
123123
if !is_unit_expression(cx, expr) {
124124
return None;
125125
}

clippy_lints/src/matches/manual_filter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn peels_blocks_incl_unsafe<'a>(expr: &'a Expr<'a>) -> &'a Expr<'a> {
6262
// <expr>
6363
// }
6464
// Returns true if <expr> resolves to `Some(x)`, `false` otherwise
65-
fn is_some_expr<'tcx>(cx: &LateContext<'_>, target: HirId, ctxt: SyntaxContext, expr: &'tcx Expr<'_>) -> bool {
65+
fn is_some_expr(cx: &LateContext<'_>, target: HirId, ctxt: SyntaxContext, expr: &Expr<'_>) -> bool {
6666
if let Some(inner_expr) = peels_blocks_incl_unsafe_opt(expr) {
6767
// there can be not statements in the block as they would be removed when switching to `.filter`
6868
if let ExprKind::Call(callee, [arg]) = inner_expr.kind {

clippy_lints/src/matches/significant_drop_in_scrutinee.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ impl<'a, 'tcx> ArmSigDropHelper<'a, 'tcx> {
377377
}
378378
}
379379

380-
fn has_significant_drop_in_arms<'tcx, 'a>(cx: &'a LateContext<'tcx>, arms: &'tcx [Arm<'_>]) -> FxHashSet<Span> {
380+
fn has_significant_drop_in_arms<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'_>]) -> FxHashSet<Span> {
381381
let mut helper = ArmSigDropHelper::new(cx);
382382
for arm in arms {
383383
helper.visit_expr(arm.body);

clippy_lints/src/matches/single_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ fn pat_in_candidate_enum<'a>(cx: &LateContext<'a>, ty: Ty<'a>, pat: &Pat<'_>) ->
153153
}
154154

155155
/// Returns `true` if the given type is an enum we know won't be expanded in the future
156-
fn in_candidate_enum<'a>(cx: &LateContext<'a>, ty: Ty<'_>) -> bool {
156+
fn in_candidate_enum(cx: &LateContext<'_>, ty: Ty<'_>) -> bool {
157157
// list of candidate `Enum`s we know will never get any more members
158158
let candidates = [sym::Cow, sym::Option, sym::Result];
159159

clippy_lints/src/methods/chars_cmp_with_unwrap.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use rustc_lint::LateContext;
99
use rustc_lint::Lint;
1010

1111
/// Wrapper fn for `CHARS_NEXT_CMP` and `CHARS_LAST_CMP` lints with `unwrap()`.
12-
pub(super) fn check<'tcx>(
13-
cx: &LateContext<'tcx>,
12+
pub(super) fn check(
13+
cx: &LateContext<'_>,
1414
info: &crate::methods::BinaryExprInfo<'_>,
1515
chain_methods: &[&str],
1616
lint: &'static Lint,

clippy_lints/src/methods/chars_last_cmp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_lint::LateContext;
44
use super::CHARS_LAST_CMP;
55

66
/// Checks for the `CHARS_LAST_CMP` lint.
7-
pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, info: &crate::methods::BinaryExprInfo<'_>) -> bool {
7+
pub(super) fn check(cx: &LateContext<'_>, info: &crate::methods::BinaryExprInfo<'_>) -> bool {
88
if chars_cmp::check(cx, info, &["chars", "last"], CHARS_LAST_CMP, "ends_with") {
99
true
1010
} else {

clippy_lints/src/methods/chars_last_cmp_with_unwrap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_lint::LateContext;
44
use super::CHARS_LAST_CMP;
55

66
/// Checks for the `CHARS_LAST_CMP` lint with `unwrap()`.
7-
pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, info: &crate::methods::BinaryExprInfo<'_>) -> bool {
7+
pub(super) fn check(cx: &LateContext<'_>, info: &crate::methods::BinaryExprInfo<'_>) -> bool {
88
if chars_cmp_with_unwrap::check(cx, info, &["chars", "last", "unwrap"], CHARS_LAST_CMP, "ends_with") {
99
true
1010
} else {

clippy_lints/src/methods/chars_next_cmp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ use rustc_lint::LateContext;
33
use super::CHARS_NEXT_CMP;
44

55
/// Checks for the `CHARS_NEXT_CMP` lint.
6-
pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, info: &crate::methods::BinaryExprInfo<'_>) -> bool {
6+
pub(super) fn check(cx: &LateContext<'_>, info: &crate::methods::BinaryExprInfo<'_>) -> bool {
77
crate::methods::chars_cmp::check(cx, info, &["chars", "next"], CHARS_NEXT_CMP, "starts_with")
88
}

clippy_lints/src/methods/chars_next_cmp_with_unwrap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ use rustc_lint::LateContext;
33
use super::CHARS_NEXT_CMP;
44

55
/// Checks for the `CHARS_NEXT_CMP` lint with `unwrap()`.
6-
pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, info: &crate::methods::BinaryExprInfo<'_>) -> bool {
6+
pub(super) fn check(cx: &LateContext<'_>, info: &crate::methods::BinaryExprInfo<'_>) -> bool {
77
crate::methods::chars_cmp_with_unwrap::check(cx, info, &["chars", "next", "unwrap"], CHARS_NEXT_CMP, "starts_with")
88
}

clippy_lints/src/methods/filter_map.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use super::MANUAL_FILTER_MAP;
1717
use super::MANUAL_FIND_MAP;
1818
use super::OPTION_FILTER_MAP;
1919

20-
fn is_method<'tcx>(cx: &LateContext<'tcx>, expr: &hir::Expr<'_>, method_name: Symbol) -> bool {
20+
fn is_method(cx: &LateContext<'_>, expr: &hir::Expr<'_>, method_name: Symbol) -> bool {
2121
match &expr.kind {
2222
hir::ExprKind::Path(QPath::TypeRelative(_, mname)) => mname.ident.name == method_name,
2323
hir::ExprKind::Path(QPath::Resolved(_, segments)) => {
@@ -46,7 +46,7 @@ fn is_method<'tcx>(cx: &LateContext<'tcx>, expr: &hir::Expr<'_>, method_name: Sy
4646
}
4747
}
4848

49-
fn is_option_filter_map<'tcx>(cx: &LateContext<'tcx>, filter_arg: &hir::Expr<'_>, map_arg: &hir::Expr<'_>) -> bool {
49+
fn is_option_filter_map(cx: &LateContext<'_>, filter_arg: &hir::Expr<'_>, map_arg: &hir::Expr<'_>) -> bool {
5050
is_method(cx, map_arg, sym::unwrap) && is_method(cx, filter_arg, sym!(is_some))
5151
}
5252

@@ -66,8 +66,8 @@ fn is_filter_some_map_unwrap(
6666

6767
/// lint use of `filter().map()` or `find().map()` for `Iterators`
6868
#[allow(clippy::too_many_arguments)]
69-
pub(super) fn check<'tcx>(
70-
cx: &LateContext<'tcx>,
69+
pub(super) fn check(
70+
cx: &LateContext<'_>,
7171
expr: &hir::Expr<'_>,
7272
filter_recv: &hir::Expr<'_>,
7373
filter_arg: &hir::Expr<'_>,

clippy_lints/src/methods/inefficient_to_string.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use rustc_span::symbol::{sym, Symbol};
1212
use super::INEFFICIENT_TO_STRING;
1313

1414
/// Checks for the `INEFFICIENT_TO_STRING` lint
15-
pub fn check<'tcx>(
16-
cx: &LateContext<'tcx>,
15+
pub fn check(
16+
cx: &LateContext<'_>,
1717
expr: &hir::Expr<'_>,
1818
method_name: Symbol,
1919
receiver: &hir::Expr<'_>,

clippy_lints/src/methods/iter_nth_zero.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_span::sym;
1010

1111
use super::ITER_NTH_ZERO;
1212

13-
pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &hir::Expr<'_>, recv: &hir::Expr<'_>, arg: &hir::Expr<'_>) {
13+
pub(super) fn check(cx: &LateContext<'_>, expr: &hir::Expr<'_>, recv: &hir::Expr<'_>, arg: &hir::Expr<'_>) {
1414
if_chain! {
1515
if is_trait_method(cx, expr, sym::Iterator);
1616
if let Some((Constant::Int(0), _)) = constant(cx, cx.typeck_results(), arg);

clippy_lints/src/methods/iter_on_single_or_empty_collections.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl IterType {
2525
}
2626
}
2727

28-
pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, method_name: &str, recv: &Expr<'_>) {
28+
pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, method_name: &str, recv: &Expr<'_>) {
2929
let item = match recv.kind {
3030
ExprKind::Array([]) => None,
3131
ExprKind::Array([e]) => Some(e),

clippy_lints/src/methods/manual_saturating_arithmetic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ enum MinMax {
6767
Max,
6868
}
6969

70-
fn is_min_or_max<'tcx>(cx: &LateContext<'tcx>, expr: &hir::Expr<'_>) -> Option<MinMax> {
70+
fn is_min_or_max(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> Option<MinMax> {
7171
// `T::max_value()` `T::min_value()` inherent methods
7272
if_chain! {
7373
if let hir::ExprKind::Call(func, args) = &expr.kind;

clippy_lints/src/methods/map_clone.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ use rustc_span::{sym, Span};
1515

1616
use super::MAP_CLONE;
1717

18-
pub(super) fn check<'tcx>(
18+
pub(super) fn check(
1919
cx: &LateContext<'_>,
2020
e: &hir::Expr<'_>,
2121
recv: &hir::Expr<'_>,
22-
arg: &'tcx hir::Expr<'_>,
22+
arg: &hir::Expr<'_>,
2323
msrv: Option<RustcVersion>,
2424
) {
2525
if_chain! {

clippy_lints/src/methods/map_err_ignore.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_span::sym;
66

77
use super::MAP_ERR_IGNORE;
88

9-
pub(super) fn check<'tcx>(cx: &LateContext<'_>, e: &Expr<'_>, arg: &'tcx Expr<'_>) {
9+
pub(super) fn check(cx: &LateContext<'_>, e: &Expr<'_>, arg: &Expr<'_>) {
1010
if let Some(method_id) = cx.typeck_results().type_dependent_def_id(e.hir_id)
1111
&& let Some(impl_id) = cx.tcx.impl_of_method(method_id)
1212
&& is_type_diagnostic_item(cx, cx.tcx.type_of(impl_id), sym::Result)

clippy_lints/src/methods/option_as_ref_deref.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use rustc_span::sym;
1313
use super::OPTION_AS_REF_DEREF;
1414

1515
/// lint use of `_.as_ref().map(Deref::deref)` for `Option`s
16-
pub(super) fn check<'tcx>(
17-
cx: &LateContext<'tcx>,
16+
pub(super) fn check(
17+
cx: &LateContext<'_>,
1818
expr: &hir::Expr<'_>,
1919
as_ref_recv: &hir::Expr<'_>,
2020
map_arg: &hir::Expr<'_>,

clippy_lints/src/methods/suspicious_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_span::sym;
88

99
use super::SUSPICIOUS_MAP;
1010

11-
pub fn check<'tcx>(cx: &LateContext<'tcx>, expr: &hir::Expr<'_>, count_recv: &hir::Expr<'_>, map_arg: &hir::Expr<'_>) {
11+
pub fn check(cx: &LateContext<'_>, expr: &hir::Expr<'_>, count_recv: &hir::Expr<'_>, map_arg: &hir::Expr<'_>) {
1212
if_chain! {
1313
if is_trait_method(cx, count_recv, sym::Iterator);
1414
let closure = expr_or_init(cx, map_arg);

clippy_lints/src/mixed_read_write_in_expression.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ enum StopEarly {
218218
Stop,
219219
}
220220

221-
fn check_expr<'a, 'tcx>(vis: &mut ReadVisitor<'a, 'tcx>, expr: &'tcx Expr<'_>) -> StopEarly {
221+
fn check_expr<'tcx>(vis: &mut ReadVisitor<'_, 'tcx>, expr: &'tcx Expr<'_>) -> StopEarly {
222222
if expr.hir_id == vis.last_expr.hir_id {
223223
return StopEarly::KeepGoing;
224224
}
@@ -265,7 +265,7 @@ fn check_expr<'a, 'tcx>(vis: &mut ReadVisitor<'a, 'tcx>, expr: &'tcx Expr<'_>) -
265265
StopEarly::KeepGoing
266266
}
267267

268-
fn check_stmt<'a, 'tcx>(vis: &mut ReadVisitor<'a, 'tcx>, stmt: &'tcx Stmt<'_>) -> StopEarly {
268+
fn check_stmt<'tcx>(vis: &mut ReadVisitor<'_, 'tcx>, stmt: &'tcx Stmt<'_>) -> StopEarly {
269269
match stmt.kind {
270270
StmtKind::Expr(expr) | StmtKind::Semi(expr) => check_expr(vis, expr),
271271
// If the declaration is of a local variable, check its initializer

clippy_lints/src/mut_key.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl MutableKeyType {
137137
}
138138
}
139139

140-
fn check_sig<'tcx>(&self, cx: &LateContext<'tcx>, item_hir_id: hir::HirId, decl: &hir::FnDecl<'_>) {
140+
fn check_sig(&self, cx: &LateContext<'_>, item_hir_id: hir::HirId, decl: &hir::FnDecl<'_>) {
141141
let fn_def_id = cx.tcx.hir().local_def_id(item_hir_id);
142142
let fn_sig = cx.tcx.fn_sig(fn_def_id);
143143
for (hir_ty, ty) in iter::zip(decl.inputs, fn_sig.inputs().skip_binder()) {

clippy_lints/src/needless_continue.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ const DROP_ELSE_BLOCK_MSG: &str = "consider dropping the `else` clause";
287287

288288
const DROP_CONTINUE_EXPRESSION_MSG: &str = "consider dropping the `continue` expression";
289289

290-
fn emit_warning<'a>(cx: &EarlyContext<'_>, data: &'a LintData<'_>, header: &str, typ: LintType) {
290+
fn emit_warning(cx: &EarlyContext<'_>, data: &LintData<'_>, header: &str, typ: LintType) {
291291
// snip is the whole *help* message that appears after the warning.
292292
// message is the warning message.
293293
// expr is the expression which the lint warning message refers to.
@@ -313,7 +313,7 @@ fn emit_warning<'a>(cx: &EarlyContext<'_>, data: &'a LintData<'_>, header: &str,
313313
);
314314
}
315315

316-
fn suggestion_snippet_for_continue_inside_if<'a>(cx: &EarlyContext<'_>, data: &'a LintData<'_>) -> String {
316+
fn suggestion_snippet_for_continue_inside_if(cx: &EarlyContext<'_>, data: &LintData<'_>) -> String {
317317
let cond_code = snippet(cx, data.if_cond.span, "..");
318318

319319
let continue_code = snippet_block(cx, data.if_block.span, "..", Some(data.if_expr.span));
@@ -327,7 +327,7 @@ fn suggestion_snippet_for_continue_inside_if<'a>(cx: &EarlyContext<'_>, data: &'
327327
)
328328
}
329329

330-
fn suggestion_snippet_for_continue_inside_else<'a>(cx: &EarlyContext<'_>, data: &'a LintData<'_>) -> String {
330+
fn suggestion_snippet_for_continue_inside_else(cx: &EarlyContext<'_>, data: &LintData<'_>) -> String {
331331
let cond_code = snippet(cx, data.if_cond.span, "..");
332332

333333
// Region B
@@ -361,7 +361,7 @@ fn suggestion_snippet_for_continue_inside_else<'a>(cx: &EarlyContext<'_>, data:
361361
)
362362
}
363363

364-
fn check_and_warn<'a>(cx: &EarlyContext<'_>, expr: &'a ast::Expr) {
364+
fn check_and_warn(cx: &EarlyContext<'_>, expr: &ast::Expr) {
365365
if_chain! {
366366
if let ast::ExprKind::Loop(loop_block, ..) = &expr.kind;
367367
if let Some(last_stmt) = loop_block.stmts.last();

clippy_lints/src/operators/op_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ fn in_impl<'tcx>(
199199
}
200200
}
201201

202-
fn are_equal<'tcx>(cx: &LateContext<'tcx>, middle_ty: Ty<'_>, hir_ty: &rustc_hir::Ty<'_>) -> bool {
202+
fn are_equal(cx: &LateContext<'_>, middle_ty: Ty<'_>, hir_ty: &rustc_hir::Ty<'_>) -> bool {
203203
if_chain! {
204204
if let ty::Adt(adt_def, _) = middle_ty.kind();
205205
if let Some(local_did) = adt_def.did().as_local();

clippy_lints/src/pattern_type_mismatch.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ enum DerefPossible {
130130
Impossible,
131131
}
132132

133-
fn apply_lint<'tcx>(cx: &LateContext<'tcx>, pat: &Pat<'_>, deref_possible: DerefPossible) -> bool {
133+
fn apply_lint(cx: &LateContext<'_>, pat: &Pat<'_>, deref_possible: DerefPossible) -> bool {
134134
let maybe_mismatch = find_first_mismatch(cx, pat);
135135
if let Some((span, mutability, level)) = maybe_mismatch {
136136
span_lint_and_help(
@@ -163,7 +163,7 @@ enum Level {
163163
Lower,
164164
}
165165

166-
fn find_first_mismatch<'tcx>(cx: &LateContext<'tcx>, pat: &Pat<'_>) -> Option<(Span, Mutability, Level)> {
166+
fn find_first_mismatch(cx: &LateContext<'_>, pat: &Pat<'_>) -> Option<(Span, Mutability, Level)> {
167167
let mut result = None;
168168
pat.walk(|p| {
169169
if result.is_some() {

0 commit comments

Comments
 (0)