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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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
}

0 commit comments

Comments
 (0)