Skip to content

Commit 02ec39b

Browse files
committed
Stop using in_band_lifetimes
1 parent fccf07b commit 02ec39b

File tree

77 files changed

+216
-189
lines changed

Some content is hidden

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

77 files changed

+216
-189
lines changed

clippy_lints/src/bool_assert_comparison.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn is_bool_lit(e: &Expr<'_>) -> bool {
4242
) && !e.span.from_expansion()
4343
}
4444

45-
fn is_impl_not_trait_with_bool_out(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) -> bool {
45+
fn is_impl_not_trait_with_bool_out(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
4646
let ty = cx.typeck_results().expr_ty(e);
4747

4848
cx.tcx

clippy_lints/src/case_sensitive_file_extension_comparisons.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fn check_case_sensitive_file_extension_comparison(ctx: &LateContext<'_>, expr: &
6767
None
6868
}
6969

70-
impl LateLintPass<'tcx> for CaseSensitiveFileExtensionComparisons {
70+
impl<'tcx> LateLintPass<'tcx> for CaseSensitiveFileExtensionComparisons {
7171
fn check_expr(&mut self, ctx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
7272
if let Some(span) = check_case_sensitive_file_extension_comparison(ctx, expr) {
7373
span_lint_and_help(

clippy_lints/src/casts/cast_ptr_alignment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_span::symbol::sym;
99

1010
use super::CAST_PTR_ALIGNMENT;
1111

12-
pub(super) fn check(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
12+
pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) {
1313
if let ExprKind::Cast(cast_expr, cast_to) = expr.kind {
1414
if is_hir_ty_cfg_dependant(cx, cast_to) {
1515
return;

clippy_lints/src/casts/cast_ref_to_mut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_middle::ty;
66

77
use super::CAST_REF_TO_MUT;
88

9-
pub(super) fn check(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
9+
pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) {
1010
if_chain! {
1111
if let ExprKind::Unary(UnOp::Deref, e) = &expr.kind;
1212
if let ExprKind::Cast(e, t) = &e.kind;

clippy_lints/src/casts/char_lit_as_u8.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_middle::ty::{self, UintTy};
99

1010
use super::CHAR_LIT_AS_U8;
1111

12-
pub(super) fn check(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
12+
pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) {
1313
if_chain! {
1414
if let ExprKind::Cast(e, _) = &expr.kind;
1515
if let ExprKind::Lit(l) = &e.kind;

clippy_lints/src/casts/ptr_as_ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_semver::RustcVersion;
1212

1313
use super::PTR_AS_PTR;
1414

15-
pub(super) fn check(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, msrv: &Option<RustcVersion>) {
15+
pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, msrv: &Option<RustcVersion>) {
1616
if !meets_msrv(msrv.as_ref(), &msrvs::POINTER_CAST) {
1717
return;
1818
}

clippy_lints/src/copies.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ struct BlockEqual {
316316

317317
/// This function can also trigger the `IF_SAME_THEN_ELSE` in which case it'll return `None` to
318318
/// abort any further processing and avoid duplicate lint triggers.
319-
fn scan_block_for_eq(cx: &LateContext<'tcx>, blocks: &[&Block<'tcx>]) -> Option<BlockEqual> {
319+
fn scan_block_for_eq(cx: &LateContext<'_>, blocks: &[&Block<'_>]) -> Option<BlockEqual> {
320320
let mut start_eq = usize::MAX;
321321
let mut end_eq = usize::MAX;
322322
let mut expr_eq = true;
@@ -385,11 +385,7 @@ fn scan_block_for_eq(cx: &LateContext<'tcx>, blocks: &[&Block<'tcx>]) -> Option<
385385
})
386386
}
387387

388-
fn check_for_warn_of_moved_symbol(
389-
cx: &LateContext<'tcx>,
390-
symbols: &FxHashSet<Symbol>,
391-
if_expr: &'tcx Expr<'_>,
392-
) -> bool {
388+
fn check_for_warn_of_moved_symbol(cx: &LateContext<'_>, symbols: &FxHashSet<Symbol>, if_expr: &Expr<'_>) -> bool {
393389
get_enclosing_block(cx, if_expr.hir_id).map_or(false, |block| {
394390
let ignore_span = block.span.shrink_to_lo().to(if_expr.span);
395391

@@ -419,13 +415,13 @@ fn check_for_warn_of_moved_symbol(
419415
}
420416

421417
fn emit_branches_sharing_code_lint(
422-
cx: &LateContext<'tcx>,
418+
cx: &LateContext<'_>,
423419
start_stmts: usize,
424420
end_stmts: usize,
425421
lint_end: bool,
426422
warn_about_moved_symbol: bool,
427-
blocks: &[&Block<'tcx>],
428-
if_expr: &'tcx Expr<'_>,
423+
blocks: &[&Block<'_>],
424+
if_expr: &Expr<'_>,
429425
) {
430426
if start_stmts == 0 && !lint_end {
431427
return;

clippy_lints/src/default.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub struct Default {
7777

7878
impl_lint_pass!(Default => [DEFAULT_TRAIT_ACCESS, FIELD_REASSIGN_WITH_DEFAULT]);
7979

80-
impl LateLintPass<'_> for Default {
80+
impl<'tcx> LateLintPass<'tcx> for Default {
8181
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
8282
if_chain! {
8383
if !expr.span.from_expansion();
@@ -110,7 +110,7 @@ impl LateLintPass<'_> for Default {
110110
}
111111

112112
#[allow(clippy::too_many_lines)]
113-
fn check_block<'tcx>(&mut self, cx: &LateContext<'tcx>, block: &Block<'tcx>) {
113+
fn check_block(&mut self, cx: &LateContext<'tcx>, block: &Block<'tcx>) {
114114
// start from the `let mut _ = _::default();` and look at all the following
115115
// statements, see if they re-assign the fields of the binding
116116
let stmts_head = match block.stmts {

clippy_lints/src/default_numeric_fallback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ declare_clippy_lint! {
5454

5555
declare_lint_pass!(DefaultNumericFallback => [DEFAULT_NUMERIC_FALLBACK]);
5656

57-
impl LateLintPass<'_> for DefaultNumericFallback {
57+
impl<'tcx> LateLintPass<'tcx> for DefaultNumericFallback {
5858
fn check_body(&mut self, cx: &LateContext<'tcx>, body: &'tcx Body<'_>) {
5959
let mut visitor = NumericFallbackVisitor::new(cx);
6060
visitor.visit_body(body);

clippy_lints/src/dereference.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ impl<'tcx> LateLintPass<'tcx> for Dereferencing {
355355
}
356356
}
357357

358-
fn try_parse_ref_op(
358+
fn try_parse_ref_op<'tcx>(
359359
tcx: TyCtxt<'tcx>,
360360
typeck: &'tcx TypeckResults<'_>,
361361
expr: &'tcx Expr<'_>,
@@ -387,7 +387,7 @@ fn try_parse_ref_op(
387387

388388
// Checks whether the type for a deref call actually changed the type, not just the mutability of
389389
// the reference.
390-
fn deref_method_same_type(result_ty: Ty<'tcx>, arg_ty: Ty<'tcx>) -> bool {
390+
fn deref_method_same_type(result_ty: Ty<'_>, arg_ty: Ty<'_>) -> bool {
391391
match (result_ty.kind(), arg_ty.kind()) {
392392
(ty::Ref(_, result_ty, _), ty::Ref(_, arg_ty, _)) => TyS::same_type(result_ty, arg_ty),
393393

@@ -457,7 +457,7 @@ fn is_linted_explicit_deref_position(parent: Option<Node<'_>>, child_id: HirId,
457457
}
458458

459459
/// Adjustments are sometimes made in the parent block rather than the expression itself.
460-
fn find_adjustments(
460+
fn find_adjustments<'tcx>(
461461
tcx: TyCtxt<'tcx>,
462462
typeck: &'tcx TypeckResults<'_>,
463463
expr: &'tcx Expr<'_>,
@@ -499,7 +499,7 @@ fn find_adjustments(
499499
}
500500

501501
#[allow(clippy::needless_pass_by_value)]
502-
fn report(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, state: State, data: StateData) {
502+
fn report(cx: &LateContext<'_>, expr: &Expr<'_>, state: State, data: StateData) {
503503
match state {
504504
State::DerefMethod {
505505
ty_changed_count,
@@ -568,7 +568,7 @@ fn report(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, state: State, data: Stat
568568
}
569569

570570
impl Dereferencing {
571-
fn check_local_usage(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>, local: HirId) {
571+
fn check_local_usage(&mut self, cx: &LateContext<'_>, e: &Expr<'_>, local: HirId) {
572572
if let Some(outer_pat) = self.ref_locals.get_mut(&local) {
573573
if let Some(pat) = outer_pat {
574574
// Check for auto-deref

0 commit comments

Comments
 (0)