Skip to content

Commit 2c89cf4

Browse files
committed
Fix clippy_lints and clippy_utils
1 parent 905105d commit 2c89cf4

Some content is hidden

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

62 files changed

+94
-94
lines changed

clippy_lints/src/booleans.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ struct Hir2Qmm<'a, 'tcx, 'v> {
205205
cx: &'a LateContext<'tcx>,
206206
}
207207

208-
impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
208+
impl<'v> Hir2Qmm<'_, '_, 'v> {
209209
fn extract(&mut self, op: BinOpKind, a: &[&'v Expr<'_>], mut v: Vec<Bool>) -> Result<Vec<Bool>, String> {
210210
for a in a {
211211
if let ExprKind::Binary(binop, lhs, rhs) = &a.kind {
@@ -292,7 +292,7 @@ struct SuggestContext<'a, 'tcx, 'v> {
292292
output: String,
293293
}
294294

295-
impl<'a, 'tcx, 'v> SuggestContext<'a, 'tcx, 'v> {
295+
impl SuggestContext<'_, '_, '_> {
296296
fn recurse(&mut self, suggestion: &Bool) -> Option<()> {
297297
use quine_mc_cluskey::Bool::{And, False, Not, Or, Term, True};
298298
match suggestion {
@@ -475,7 +475,7 @@ fn terminal_stats(b: &Bool) -> Stats {
475475
stats
476476
}
477477

478-
impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
478+
impl<'tcx> NonminimalBoolVisitor<'_, 'tcx> {
479479
fn bool_expr(&self, e: &'tcx Expr<'_>) {
480480
let mut h2q = Hir2Qmm {
481481
terminals: Vec::new(),
@@ -582,7 +582,7 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
582582
}
583583
}
584584

585-
impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> {
585+
impl<'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'_, 'tcx> {
586586
fn visit_expr(&mut self, e: &'tcx Expr<'_>) {
587587
if !e.span.from_expansion() {
588588
match &e.kind {

clippy_lints/src/box_default.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn is_local_vec_expn(cx: &LateContext<'_>, expr: &Expr<'_>, ref_expr: &Expr<'_>)
9191
#[derive(Default)]
9292
struct InferVisitor(bool);
9393

94-
impl<'tcx> Visitor<'tcx> for InferVisitor {
94+
impl Visitor<'_> for InferVisitor {
9595
fn visit_ty(&mut self, t: &Ty<'_>) {
9696
self.0 |= matches!(t.kind, TyKind::Infer | TyKind::OpaqueDef(..) | TyKind::TraitObject(..));
9797
if !self.0 {

clippy_lints/src/checked_conversions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl CheckedConversions {
4848

4949
impl_lint_pass!(CheckedConversions => [CHECKED_CONVERSIONS]);
5050

51-
impl<'tcx> LateLintPass<'tcx> for CheckedConversions {
51+
impl LateLintPass<'_> for CheckedConversions {
5252
fn check_expr(&mut self, cx: &LateContext<'_>, item: &Expr<'_>) {
5353
if let ExprKind::Binary(op, lhs, rhs) = item.kind
5454
&& let (lt1, gt1, op2) = match op.node {

clippy_lints/src/default_numeric_fallback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl<'a, 'tcx> NumericFallbackVisitor<'a, 'tcx> {
119119
}
120120
}
121121

122-
impl<'a, 'tcx> Visitor<'tcx> for NumericFallbackVisitor<'a, 'tcx> {
122+
impl<'tcx> Visitor<'tcx> for NumericFallbackVisitor<'_, 'tcx> {
123123
fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
124124
match &expr.kind {
125125
ExprKind::Block(

clippy_lints/src/doc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ impl<'a, 'tcx> FindPanicUnwrap<'a, 'tcx> {
970970
}
971971
}
972972

973-
impl<'a, 'tcx> Visitor<'tcx> for FindPanicUnwrap<'a, 'tcx> {
973+
impl<'tcx> Visitor<'tcx> for FindPanicUnwrap<'_, 'tcx> {
974974
type NestedFilter = nested_filter::OnlyBodies;
975975

976976
fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {

clippy_lints/src/empty_enum.rs

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

6161
declare_lint_pass!(EmptyEnum => [EMPTY_ENUM]);
6262

63-
impl<'tcx> LateLintPass<'tcx> for EmptyEnum {
63+
impl LateLintPass<'_> for EmptyEnum {
6464
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
6565
if let ItemKind::Enum(..) = item.kind
6666
// Only suggest the `never_type` if the feature is enabled

clippy_lints/src/escape.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ fn is_argument(tcx: TyCtxt<'_>, id: HirId) -> bool {
141141
matches!(tcx.parent_hir_node(id), Node::Param(_))
142142
}
143143

144-
impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
144+
impl<'tcx> Delegate<'tcx> for EscapeDelegate<'_, 'tcx> {
145145
fn consume(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId) {
146146
if cmt.place.projections.is_empty() {
147147
if let PlaceBase::Local(lid) = cmt.place.base {
@@ -188,7 +188,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
188188
fn fake_read(&mut self, _: &PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
189189
}
190190

191-
impl<'a, 'tcx> EscapeDelegate<'a, 'tcx> {
191+
impl<'tcx> EscapeDelegate<'_, 'tcx> {
192192
fn is_large_box(&self, ty: Ty<'tcx>) -> bool {
193193
// Large types need to be boxed to avoid stack overflows.
194194
if ty.is_box() {

clippy_lints/src/excessive_nesting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl NestingVisitor<'_, '_> {
135135
}
136136
}
137137

138-
impl<'conf, 'cx> Visitor<'_> for NestingVisitor<'conf, 'cx> {
138+
impl Visitor<'_> for NestingVisitor<'_, '_> {
139139
fn visit_block(&mut self, block: &Block) {
140140
if block.span.from_expansion() {
141141
return;

clippy_lints/src/extra_unused_type_parameters.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ fn bound_to_trait_def_id(bound: &GenericBound<'_>) -> Option<LocalDefId> {
193193
bound.trait_ref()?.trait_def_id()?.as_local()
194194
}
195195

196-
impl<'cx, 'tcx> Visitor<'tcx> for TypeWalker<'cx, 'tcx> {
196+
impl<'tcx> Visitor<'tcx> for TypeWalker<'_, 'tcx> {
197197
type NestedFilter = nested_filter::OnlyBodies;
198198

199199
fn visit_ty(&mut self, t: &'tcx Ty<'tcx>) {

clippy_lints/src/fallible_impl_from.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn lint_impl_body(cx: &LateContext<'_>, impl_span: Span, impl_items: &[hir::Impl
7373
result: Vec<Span>,
7474
}
7575

76-
impl<'a, 'tcx> Visitor<'tcx> for FindPanicUnwrap<'a, 'tcx> {
76+
impl<'tcx> Visitor<'tcx> for FindPanicUnwrap<'_, 'tcx> {
7777
fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
7878
if let Some(macro_call) = root_macro_call_first_node(self.lcx, expr) {
7979
if is_panic(self.lcx, macro_call.def_id) {

clippy_lints/src/format_args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ struct FormatArgsExpr<'a, 'tcx> {
218218
ignore_mixed: bool,
219219
}
220220

221-
impl<'a, 'tcx> FormatArgsExpr<'a, 'tcx> {
221+
impl FormatArgsExpr<'_, '_> {
222222
fn check_templates(&self) {
223223
for piece in &self.format_args.template {
224224
if let FormatArgsPiece::Placeholder(placeholder) = piece

clippy_lints/src/format_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct FormatImplExpr<'a, 'tcx> {
148148
format_trait_impl: FormatTraitNames,
149149
}
150150

151-
impl<'a, 'tcx> FormatImplExpr<'a, 'tcx> {
151+
impl FormatImplExpr<'_, '_> {
152152
fn check_to_string_in_display(&self) {
153153
if self.format_trait_impl.name == sym::Display
154154
&& let ExprKind::MethodCall(path, self_arg, ..) = self.expr.kind

clippy_lints/src/from_over_into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct SelfFinder<'a, 'tcx> {
126126
invalid: bool,
127127
}
128128

129-
impl<'a, 'tcx> Visitor<'tcx> for SelfFinder<'a, 'tcx> {
129+
impl<'tcx> Visitor<'tcx> for SelfFinder<'_, 'tcx> {
130130
type NestedFilter = OnlyBodies;
131131

132132
fn nested_visit_map(&mut self) -> Self::Map {

clippy_lints/src/implicit_hasher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ impl<'a, 'tcx> ImplicitHasherTypeVisitor<'a, 'tcx> {
281281
}
282282
}
283283

284-
impl<'a, 'tcx> Visitor<'tcx> for ImplicitHasherTypeVisitor<'a, 'tcx> {
284+
impl<'tcx> Visitor<'tcx> for ImplicitHasherTypeVisitor<'_, 'tcx> {
285285
fn visit_ty(&mut self, t: &'tcx hir::Ty<'_>) {
286286
if let Some(target) = ImplicitHasherType::new(self.cx, t) {
287287
self.found.push(target);
@@ -318,7 +318,7 @@ impl<'a, 'b, 'tcx> ImplicitHasherConstructorVisitor<'a, 'b, 'tcx> {
318318
}
319319
}
320320

321-
impl<'a, 'b, 'tcx> Visitor<'tcx> for ImplicitHasherConstructorVisitor<'a, 'b, 'tcx> {
321+
impl<'tcx> Visitor<'tcx> for ImplicitHasherConstructorVisitor<'_, '_, 'tcx> {
322322
type NestedFilter = nested_filter::OnlyBodies;
323323

324324
fn visit_body(&mut self, body: &Body<'tcx>) {

clippy_lints/src/index_refutable_slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ struct SliceIndexLintingVisitor<'a, 'tcx> {
226226
max_suggested_slice: u64,
227227
}
228228

229-
impl<'a, 'tcx> Visitor<'tcx> for SliceIndexLintingVisitor<'a, 'tcx> {
229+
impl<'tcx> Visitor<'tcx> for SliceIndexLintingVisitor<'_, 'tcx> {
230230
type NestedFilter = nested_filter::OnlyBodies;
231231

232232
fn nested_visit_map(&mut self) -> Self::Map {

clippy_lints/src/lifetimes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ impl<'a, 'tcx> RefVisitor<'a, 'tcx> {
397397
}
398398
}
399399

400-
impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
400+
impl<'tcx> Visitor<'tcx> for RefVisitor<'_, 'tcx> {
401401
// for lifetimes as parameters of generics
402402
fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) {
403403
self.lts.push(*lifetime);

clippy_lints/src/loops/manual_memcpy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ fn build_manual_memcpy_suggestion<'tcx>(
209209
#[derive(Clone)]
210210
struct MinifyingSugg<'a>(Sugg<'a>);
211211

212-
impl<'a> Display for MinifyingSugg<'a> {
212+
impl Display for MinifyingSugg<'_> {
213213
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
214214
self.0.fmt(f)
215215
}

clippy_lints/src/loops/needless_range_loop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ struct VarVisitor<'a, 'tcx> {
241241
prefer_mutable: bool,
242242
}
243243

244-
impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
244+
impl<'tcx> VarVisitor<'_, 'tcx> {
245245
fn check(&mut self, idx: &'tcx Expr<'_>, seqexpr: &'tcx Expr<'_>, expr: &'tcx Expr<'_>) -> bool {
246246
if let ExprKind::Path(ref seqpath) = seqexpr.kind
247247
// the indexed container is referenced by a name
@@ -292,7 +292,7 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
292292
}
293293
}
294294

295-
impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
295+
impl<'tcx> Visitor<'tcx> for VarVisitor<'_, 'tcx> {
296296
fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
297297
if let ExprKind::MethodCall(meth, args_0, [args_1, ..], _) = &expr.kind
298298
// a range index op

clippy_lints/src/loops/same_item_push.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl<'a, 'tcx> SameItemPushVisitor<'a, 'tcx> {
123123
}
124124
}
125125

126-
impl<'a, 'tcx> Visitor<'tcx> for SameItemPushVisitor<'a, 'tcx> {
126+
impl<'tcx> Visitor<'tcx> for SameItemPushVisitor<'_, 'tcx> {
127127
fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
128128
match &expr.kind {
129129
// Non-determinism may occur ... don't give a lint

clippy_lints/src/loops/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<'a, 'tcx> IncrementVisitor<'a, 'tcx> {
4444
}
4545
}
4646

47-
impl<'a, 'tcx> Visitor<'tcx> for IncrementVisitor<'a, 'tcx> {
47+
impl<'tcx> Visitor<'tcx> for IncrementVisitor<'_, 'tcx> {
4848
fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
4949
// If node is a variable
5050
if let Some(def_id) = path_to_local(expr) {
@@ -138,7 +138,7 @@ impl<'a, 'tcx> InitializeVisitor<'a, 'tcx> {
138138
}
139139
}
140140

141-
impl<'a, 'tcx> Visitor<'tcx> for InitializeVisitor<'a, 'tcx> {
141+
impl<'tcx> Visitor<'tcx> for InitializeVisitor<'_, 'tcx> {
142142
type NestedFilter = nested_filter::OnlyBodies;
143143

144144
fn visit_local(&mut self, l: &'tcx LetStmt<'_>) {

clippy_lints/src/loops/while_immutable_condition.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct VarCollectorVisitor<'a, 'tcx> {
8484
skip: bool,
8585
}
8686

87-
impl<'a, 'tcx> VarCollectorVisitor<'a, 'tcx> {
87+
impl<'tcx> VarCollectorVisitor<'_, 'tcx> {
8888
fn insert_def_id(&mut self, ex: &'tcx Expr<'_>) {
8989
if let ExprKind::Path(ref qpath) = ex.kind
9090
&& let QPath::Resolved(None, _) = *qpath
@@ -103,7 +103,7 @@ impl<'a, 'tcx> VarCollectorVisitor<'a, 'tcx> {
103103
}
104104
}
105105

106-
impl<'a, 'tcx> Visitor<'tcx> for VarCollectorVisitor<'a, 'tcx> {
106+
impl<'tcx> Visitor<'tcx> for VarCollectorVisitor<'_, 'tcx> {
107107
fn visit_expr(&mut self, ex: &'tcx Expr<'_>) {
108108
match ex.kind {
109109
ExprKind::Path(_) => self.insert_def_id(ex),

clippy_lints/src/loops/while_let_on_iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ fn needs_mutable_borrow(cx: &LateContext<'_>, iter_expr: &IterExpr, loop_expr: &
283283
found_local: bool,
284284
used_after: bool,
285285
}
286-
impl<'a, 'b, 'tcx> Visitor<'tcx> for NestedLoopVisitor<'a, 'b, 'tcx> {
286+
impl<'tcx> Visitor<'tcx> for NestedLoopVisitor<'_, '_, 'tcx> {
287287
type NestedFilter = OnlyBodies;
288288
fn nested_visit_map(&mut self) -> Self::Map {
289289
self.cx.tcx.hir()

clippy_lints/src/macro_metavars_in_unsafe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fn is_public_macro(cx: &LateContext<'_>, def_id: LocalDefId) -> bool {
149149
&& !cx.tcx.is_doc_hidden(def_id)
150150
}
151151

152-
impl<'a, 'tcx> Visitor<'tcx> for BodyVisitor<'a, 'tcx> {
152+
impl<'tcx> Visitor<'tcx> for BodyVisitor<'_, 'tcx> {
153153
fn visit_stmt(&mut self, s: &'tcx Stmt<'tcx>) {
154154
let from_expn = s.span.from_expansion();
155155
if from_expn {

clippy_lints/src/macro_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl MacroUseImports {
8181
}
8282
}
8383

84-
impl<'tcx> LateLintPass<'tcx> for MacroUseImports {
84+
impl LateLintPass<'_> for MacroUseImports {
8585
fn check_item(&mut self, cx: &LateContext<'_>, item: &hir::Item<'_>) {
8686
if cx.sess().opts.edition >= Edition::Edition2018
8787
&& let hir::ItemKind::Use(path, _kind) = &item.kind

clippy_lints/src/manual_clamp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ enum MaybeBorrowedStmtKind<'a> {
741741
Owned(StmtKind<'a>),
742742
}
743743

744-
impl<'a> Clone for MaybeBorrowedStmtKind<'a> {
744+
impl Clone for MaybeBorrowedStmtKind<'_> {
745745
fn clone(&self) -> Self {
746746
match self {
747747
Self::Borrowed(t) => Self::Borrowed(t),

clippy_lints/src/manual_strip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ fn find_stripping<'tcx>(
203203
results: Vec<Span>,
204204
}
205205

206-
impl<'a, 'tcx> Visitor<'tcx> for StrippingFinder<'a, 'tcx> {
206+
impl<'tcx> Visitor<'tcx> for StrippingFinder<'_, 'tcx> {
207207
fn visit_expr(&mut self, ex: &'tcx Expr<'_>) {
208208
if is_ref_str(self.cx, ex)
209209
&& let unref = peel_ref(ex)

clippy_lints/src/map_unit_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ fn lint_map_unit_fn(
251251
}
252252
}
253253

254-
impl<'tcx> LateLintPass<'tcx> for MapUnit {
254+
impl LateLintPass<'_> for MapUnit {
255255
fn check_stmt(&mut self, cx: &LateContext<'_>, stmt: &hir::Stmt<'_>) {
256256
if let hir::StmtKind::Semi(expr) = stmt.kind
257257
&& !stmt.span.from_expansion()

clippy_lints/src/matches/match_str_case_mismatch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct MatchExprVisitor<'a, 'tcx> {
4040
case_method: Option<CaseMethod>,
4141
}
4242

43-
impl<'a, 'tcx> Visitor<'tcx> for MatchExprVisitor<'a, 'tcx> {
43+
impl<'tcx> Visitor<'tcx> for MatchExprVisitor<'_, 'tcx> {
4444
fn visit_expr(&mut self, ex: &'tcx Expr<'_>) {
4545
match ex.kind {
4646
ExprKind::MethodCall(segment, receiver, [], _) if self.case_altered(segment.ident.as_str(), receiver) => {},
@@ -49,7 +49,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MatchExprVisitor<'a, 'tcx> {
4949
}
5050
}
5151

52-
impl<'a, 'tcx> MatchExprVisitor<'a, 'tcx> {
52+
impl MatchExprVisitor<'_, '_> {
5353
fn case_altered(&mut self, segment_ident: &str, receiver: &Expr<'_>) -> bool {
5454
if let Some(case_method) = get_case_method(segment_ident) {
5555
let ty = self.cx.typeck_results().expr_ty(receiver).peel_refs();

clippy_lints/src/matches/overlapping_arms.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ where
9696
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
9797
struct RangeBound<'a, T>(T, BoundKind, &'a SpannedRange<T>);
9898

99-
impl<'a, T: Copy + Ord> PartialOrd for RangeBound<'a, T> {
99+
impl<T: Copy + Ord> PartialOrd for RangeBound<'_, T> {
100100
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
101101
Some(self.cmp(other))
102102
}
103103
}
104104

105-
impl<'a, T: Copy + Ord> Ord for RangeBound<'a, T> {
105+
impl<T: Copy + Ord> Ord for RangeBound<'_, T> {
106106
fn cmp(&self, RangeBound(other_value, other_kind, _): &Self) -> Ordering {
107107
let RangeBound(self_value, self_kind, _) = *self;
108108
(self_value, self_kind).cmp(&(*other_value, *other_kind))

clippy_lints/src/matches/significant_drop_in_scrutinee.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ fn ty_has_erased_regions(ty: Ty<'_>) -> bool {
424424
ty.visit_with(&mut V).is_break()
425425
}
426426

427-
impl<'a, 'tcx> Visitor<'tcx> for SigDropHelper<'a, 'tcx> {
427+
impl<'tcx> Visitor<'tcx> for SigDropHelper<'_, 'tcx> {
428428
fn visit_expr(&mut self, ex: &'tcx Expr<'_>) {
429429
// We've emitted a lint on some neighborhood expression. That lint will suggest to move out the
430430
// _parent_ expression (not the expression itself). Since we decide to move out the parent
@@ -495,7 +495,7 @@ fn has_significant_drop_in_arms<'tcx>(cx: &LateContext<'tcx>, arms: &[&'tcx Expr
495495
helper.found_sig_drop_spans
496496
}
497497

498-
impl<'a, 'tcx> Visitor<'tcx> for ArmSigDropHelper<'a, 'tcx> {
498+
impl<'tcx> Visitor<'tcx> for ArmSigDropHelper<'_, 'tcx> {
499499
fn visit_expr(&mut self, ex: &'tcx Expr<'tcx>) {
500500
if self.sig_drop_checker.is_sig_drop_expr(ex) {
501501
self.found_sig_drop_spans.insert(ex.span);

clippy_lints/src/methods/needless_collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ struct UsedCountVisitor<'a, 'tcx> {
441441
count: usize,
442442
}
443443

444-
impl<'a, 'tcx> Visitor<'tcx> for UsedCountVisitor<'a, 'tcx> {
444+
impl<'tcx> Visitor<'tcx> for UsedCountVisitor<'_, 'tcx> {
445445
type NestedFilter = nested_filter::OnlyBodies;
446446

447447
fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {

clippy_lints/src/methods/option_map_unwrap_or.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ struct UnwrapVisitor<'a, 'tcx> {
130130
identifiers: FxHashSet<HirId>,
131131
}
132132

133-
impl<'a, 'tcx> Visitor<'tcx> for UnwrapVisitor<'a, 'tcx> {
133+
impl<'tcx> Visitor<'tcx> for UnwrapVisitor<'_, 'tcx> {
134134
type NestedFilter = nested_filter::All;
135135

136136
fn visit_path(&mut self, path: &Path<'tcx>, _: HirId) {
@@ -154,7 +154,7 @@ struct ReferenceVisitor<'a, 'tcx> {
154154
unwrap_or_span: Span,
155155
}
156156

157-
impl<'a, 'tcx> Visitor<'tcx> for ReferenceVisitor<'a, 'tcx> {
157+
impl<'tcx> Visitor<'tcx> for ReferenceVisitor<'_, 'tcx> {
158158
type NestedFilter = nested_filter::All;
159159
type Result = ControlFlow<()>;
160160
fn visit_expr(&mut self, expr: &'tcx rustc_hir::Expr<'_>) -> ControlFlow<()> {

0 commit comments

Comments
 (0)