Skip to content

Commit 7db5d0e

Browse files
committed
Auto merge of #4221 - lzutao:redundant-lifetime, r=matthiaskrgr
Fix warnings about unnecessary lifetime bounds Rustup rust-lang/rust#61172 changelog: none
2 parents 149a988 + 4fa498a commit 7db5d0e

34 files changed

+83
-87
lines changed

clippy_lints/src/assign_ops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,13 @@ fn is_commutative(op: hir::BinOpKind) -> bool {
236236
}
237237
}
238238

239-
struct ExprVisitor<'a, 'tcx: 'a> {
239+
struct ExprVisitor<'a, 'tcx> {
240240
assignee: &'a hir::Expr,
241241
counter: u8,
242242
cx: &'a LateContext<'a, 'tcx>,
243243
}
244244

245-
impl<'a, 'tcx: 'a> Visitor<'tcx> for ExprVisitor<'a, 'tcx> {
245+
impl<'a, 'tcx> Visitor<'tcx> for ExprVisitor<'a, 'tcx> {
246246
fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
247247
if SpanlessEq::new(self.cx).ignore_fn().eq_expr(self.assignee, expr) {
248248
self.counter += 1;

clippy_lints/src/block_in_if_condition.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ declare_clippy_lint! {
4444

4545
declare_lint_pass!(BlockInIfCondition => [BLOCK_IN_IF_CONDITION_EXPR, BLOCK_IN_IF_CONDITION_STMT]);
4646

47-
struct ExVisitor<'a, 'tcx: 'a> {
47+
struct ExVisitor<'a, 'tcx> {
4848
found_block: Option<&'tcx Expr>,
4949
cx: &'a LateContext<'a, 'tcx>,
5050
}
5151

52-
impl<'a, 'tcx: 'a> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
52+
impl<'a, 'tcx> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
5353
fn visit_expr(&mut self, expr: &'tcx Expr) {
5454
if let ExprKind::Closure(_, _, eid, _, _) = expr.node {
5555
let body = self.cx.tcx.hir().body(eid);

clippy_lints/src/booleans.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonminimalBool {
6868
}
6969
}
7070

71-
struct NonminimalBoolVisitor<'a, 'tcx: 'a> {
71+
struct NonminimalBoolVisitor<'a, 'tcx> {
7272
cx: &'a LateContext<'a, 'tcx>,
7373
}
7474

7575
use quine_mc_cluskey::Bool;
76-
struct Hir2Qmm<'a, 'tcx: 'a, 'v> {
76+
struct Hir2Qmm<'a, 'tcx, 'v> {
7777
terminals: Vec<&'v Expr>,
7878
cx: &'a LateContext<'a, 'tcx>,
7979
}
@@ -155,7 +155,7 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
155155
}
156156
}
157157

158-
struct SuggestContext<'a, 'tcx: 'a, 'v> {
158+
struct SuggestContext<'a, 'tcx, 'v> {
159159
terminals: &'v [&'v Expr],
160160
cx: &'a LateContext<'a, 'tcx>,
161161
output: String,

clippy_lints/src/cognitive_complexity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl CognitiveComplexity {
4141
impl_lint_pass!(CognitiveComplexity => [COGNITIVE_COMPLEXITY]);
4242

4343
impl CognitiveComplexity {
44-
fn check<'a, 'tcx: 'a>(&mut self, cx: &'a LateContext<'a, 'tcx>, body: &'tcx Body, span: Span) {
44+
fn check<'a, 'tcx>(&mut self, cx: &'a LateContext<'a, 'tcx>, body: &'tcx Body, span: Span) {
4545
if in_macro_or_desugar(span) {
4646
return;
4747
}
@@ -132,7 +132,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CognitiveComplexity {
132132
}
133133
}
134134

135-
struct CCHelper<'a, 'tcx: 'a> {
135+
struct CCHelper<'a, 'tcx> {
136136
match_arms: u64,
137137
divergence: u64,
138138
returns: u64,

clippy_lints/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub fn constant_context<'c, 'cc>(
210210
}
211211
}
212212

213-
pub struct ConstEvalLateContext<'a, 'tcx: 'a> {
213+
pub struct ConstEvalLateContext<'a, 'tcx> {
214214
lcx: &'a LateContext<'a, 'tcx>,
215215
tables: &'a ty::TypeckTables<'tcx>,
216216
param_env: ty::ParamEnv<'tcx>,

clippy_lints/src/entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fn check_cond<'a, 'tcx, 'b>(
112112
None
113113
}
114114

115-
struct InsertVisitor<'a, 'tcx: 'a, 'b> {
115+
struct InsertVisitor<'a, 'tcx, 'b> {
116116
cx: &'a LateContext<'a, 'tcx>,
117117
span: Span,
118118
ty: &'static str,

clippy_lints/src/escape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn is_non_trait_box(ty: Ty<'_>) -> bool {
4343
ty.is_box() && !ty.boxed_ty().is_trait()
4444
}
4545

46-
struct EscapeDelegate<'a, 'tcx: 'a> {
46+
struct EscapeDelegate<'a, 'tcx> {
4747
cx: &'a LateContext<'a, 'tcx>,
4848
set: HirIdSet,
4949
too_large_for_stack: u64,

clippy_lints/src/eval_order_dependence.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EvalOrderDependence {
9292
}
9393
}
9494

95-
struct DivergenceVisitor<'a, 'tcx: 'a> {
95+
struct DivergenceVisitor<'a, 'tcx> {
9696
cx: &'a LateContext<'a, 'tcx>,
9797
}
9898

@@ -272,7 +272,7 @@ fn check_stmt<'a, 'tcx>(vis: &mut ReadVisitor<'a, 'tcx>, stmt: &'tcx Stmt) -> St
272272
}
273273

274274
/// A visitor that looks for reads from a variable.
275-
struct ReadVisitor<'a, 'tcx: 'a> {
275+
struct ReadVisitor<'a, 'tcx> {
276276
cx: &'a LateContext<'a, 'tcx>,
277277
/// The ID of the variable we're looking for.
278278
var: HirId,

clippy_lints/src/fallible_impl_from.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ fn lint_impl_body<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, impl_span: Span, impl_it
4949
use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
5050
use rustc::hir::*;
5151

52-
struct FindPanicUnwrap<'a, 'tcx: 'a> {
52+
struct FindPanicUnwrap<'a, 'tcx> {
5353
lcx: &'a LateContext<'a, 'tcx>,
5454
tables: &'tcx ty::TypeckTables<'tcx>,
5555
result: Vec<Span>,
5656
}
5757

58-
impl<'a, 'tcx: 'a> Visitor<'tcx> for FindPanicUnwrap<'a, 'tcx> {
58+
impl<'a, 'tcx> Visitor<'tcx> for FindPanicUnwrap<'a, 'tcx> {
5959
fn visit_expr(&mut self, expr: &'tcx Expr) {
6060
// check for `begin_panic`
6161
if_chain! {

clippy_lints/src/functions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ fn raw_ptr_arg(arg: &hir::Arg, ty: &hir::Ty) -> Option<hir::HirId> {
291291
}
292292
}
293293

294-
struct DerefVisitor<'a, 'tcx: 'a> {
294+
struct DerefVisitor<'a, 'tcx> {
295295
cx: &'a LateContext<'a, 'tcx>,
296296
ptrs: FxHashSet<hir::HirId>,
297297
tables: &'a ty::TypeckTables<'tcx>,
@@ -330,7 +330,7 @@ impl<'a, 'tcx> hir::intravisit::Visitor<'tcx> for DerefVisitor<'a, 'tcx> {
330330
}
331331
}
332332

333-
impl<'a, 'tcx: 'a> DerefVisitor<'a, 'tcx> {
333+
impl<'a, 'tcx> DerefVisitor<'a, 'tcx> {
334334
fn check_arg(&self, ptr: &hir::Expr) {
335335
if let hir::ExprKind::Path(ref qpath) = ptr.node {
336336
if let Res::Local(id) = self.cx.tables.qpath_res(qpath, ptr.hir_id) {

0 commit comments

Comments
 (0)