Skip to content

Commit 8732557

Browse files
author
Ype Kingma
committed
Dogfood lints and input code fmt
1 parent b5eb8c5 commit 8732557

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

clippy_lints/src/lifetimes_bound_nested_ref.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,13 @@ impl Ord for BoundLftPair {
217217
fn at_least_2_explicit_lifetimes<'a>(generic_params: &'a [GenericParam<'a>]) -> bool {
218218
generic_params
219219
.iter()
220-
.filter(|gp| match gp.kind {
221-
GenericParamKind::Lifetime {
222-
kind: LifetimeParamKind::Explicit,
223-
} => true,
224-
_ => false,
220+
.filter(|gp| {
221+
matches!(
222+
gp.kind,
223+
GenericParamKind::Lifetime {
224+
kind: LifetimeParamKind::Explicit,
225+
}
226+
)
225227
})
226228
.enumerate()
227229
.any(|(i, _)| i >= 1)
@@ -303,8 +305,8 @@ fn collect_nested_ref_implied_bounds(
303305
}
304306
}
305307

306-
fn report_lints<'tcx2>(
307-
cx: &LateContext<'tcx2>,
308+
fn report_lints(
309+
cx: &LateContext<'_>,
308310
span: rustc_span::Span,
309311
declared_bounds: &BTreeSet<BoundLftPair>,
310312
implied_bounds: &BTreeSet<BoundLftPair>,

tests/ui/lifetimes_bound_nested_ref.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub fn lifetime_translator_2<'lfta, 'lftb: 'lfta, T>(val_a: &'lfta &'lftb T, _va
1111
val_a
1212
}
1313

14-
1514
// helper declarations for issue 84591
1615
trait Supertrait<'a, 'b> {
1716
fn convert<T: ?Sized>(x: &'a T) -> &'b T;

tests/ui/lifetimes_bound_nested_ref.stderr

+4-5
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,27 @@ LL | pub fn lifetime_translator_2<'lfta, 'lftb: 'lfta, T>(val_a: &'lfta &'lftb T
1717
= help: to override `-D warnings` add `#[allow(clippy::explicit_lifetimes_bound_nested_ref)]`
1818

1919
error: missing lifetime bound declation: 'a: 'b
20-
--> tests/ui/lifetimes_bound_nested_ref.rs:31:5
20+
--> tests/ui/lifetimes_bound_nested_ref.rs:30:5
2121
|
2222
LL | impl<'a, 'b> Subtrait<'a, 'b, &'b &'a ()> for MyStruct {}
2323
| ^^^^^^^^
2424

2525
error: declared lifetime bound is implied: 'a: 'b
26-
--> tests/ui/lifetimes_bound_nested_ref.rs:36:5
26+
--> tests/ui/lifetimes_bound_nested_ref.rs:35:5
2727
|
2828
LL | impl<'a: 'b, 'b> Subtrait2<'a, 'b, &'b &'a ()> for MyStruct {}
2929
| ^^^^^^^^^^^^
3030

3131
error: missing lifetime bound declation: 'a: 'b
32-
--> tests/ui/lifetimes_bound_nested_ref.rs:52:5
32+
--> tests/ui/lifetimes_bound_nested_ref.rs:51:5
3333
|
3434
LL | impl<'a, 'b> Extend1<'a, 'b> for <&'b &'a () as Trait1>::Type1 {
3535
| ^^^^^^^^
3636

3737
error: declared lifetime bound is implied: 'a: 'b
38-
--> tests/ui/lifetimes_bound_nested_ref.rs:71:5
38+
--> tests/ui/lifetimes_bound_nested_ref.rs:70:5
3939
|
4040
LL | impl<'a: 'b, 'b> Extend2<'a, 'b> for <&'b &'a () as Trait2>::Type2 {
4141
| ^^^^^^^^^^^^
4242

4343
error: aborting due to 6 previous errors
44-

0 commit comments

Comments
 (0)