Skip to content

Commit 12dfb3c

Browse files
committed
Suppress clippy::elidable_lifetime_names lint in generated code
``` error: the following explicit lifetimes could be elided: 'a --> examples/pinned_drop-expanded.rs:98:33 | 98 | fn __assert_not_repr_packed<'a, T>(this: &Struct<'a, T>) { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names = note: `-D clippy::elidable-lifetime-names` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::elidable_lifetime_names)]` help: elide the lifetimes | 98 - fn __assert_not_repr_packed<'a, T>(this: &Struct<'a, T>) { 98 + fn __assert_not_repr_packed<T>(this: &Struct<'_, T>) { | error: the following explicit lifetimes could be elided: 'a --> examples/pinned_drop-expanded.rs:103:10 | 103 | impl<'a, T> ::pin_project::__private::Drop for Struct<'a, T> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names help: elide the lifetimes | 103 - impl<'a, T> ::pin_project::__private::Drop for Struct<'a, T> { 103 + impl<T> ::pin_project::__private::Drop for Struct<'_, T> { | error: could not compile `pin-project` (example "pinned_drop-expanded") due to 2 previous errors warning: build failed, waiting for other jobs to finish... error: the following explicit lifetimes could be elided: 'a --> tests/proper_unpin.rs:147:19 | 147 | struct PinRef<'a, T, U> { | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names = note: `-D clippy::elidable-lifetime-names` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::elidable_lifetime_names)]` help: elide the lifetimes | 147 - struct PinRef<'a, T, U> { 147 + struct PinRef<'_, T, U> { | ```
1 parent 2714ef5 commit 12dfb3c

40 files changed

+41
-0
lines changed

.github/.cspell/project-dictionary.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
compiletest
2+
elidable
23
expandtest
34
HRTB
45
overindented

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
1212

1313
## [Unreleased]
1414

15+
- Suppress `clippy::elidable_lifetime_names` lint in generated code.
16+
1517
## [1.1.9] - 2025-02-03
1618

1719
- Suppress `clippy::missing_const_for_fn` lint in generated code.

examples/pinned_drop-expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
unknown_lints,
3333
renamed_and_removed_lints,
3434
unnameable_types,
35+
clippy::elidable_lifetime_names,
3536
clippy::mut_mut,
3637
clippy::needless_lifetimes,
3738
clippy::undocumented_unsafe_blocks

pin-project-internal/src/pin_project/derive.rs

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ impl GenerateTokens {
8989
#[allow(
9090
unused_qualifications,
9191
#allowed_lints
92+
clippy::elidable_lifetime_names,
9293
clippy::missing_const_for_fn,
9394
clippy::needless_lifetimes,
9495
clippy::semicolon_if_nothing_returned,

tests/expand/default/enum.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ where
7575
clippy::redundant_pub_crate,
7676
clippy::single_char_lifetime_names,
7777
clippy::type_repetition_in_bounds,
78+
clippy::elidable_lifetime_names,
7879
clippy::missing_const_for_fn,
7980
clippy::needless_lifetimes,
8081
clippy::semicolon_if_nothing_returned,

tests/expand/default/struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ struct Struct<T, U> {
2020
clippy::redundant_pub_crate,
2121
clippy::single_char_lifetime_names,
2222
clippy::type_repetition_in_bounds,
23+
clippy::elidable_lifetime_names,
2324
clippy::missing_const_for_fn,
2425
clippy::needless_lifetimes,
2526
clippy::semicolon_if_nothing_returned,

tests/expand/default/tuple_struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct TupleStruct<T, U>(#[pin] T, U);
1616
clippy::redundant_pub_crate,
1717
clippy::single_char_lifetime_names,
1818
clippy::type_repetition_in_bounds,
19+
clippy::elidable_lifetime_names,
1920
clippy::missing_const_for_fn,
2021
clippy::needless_lifetimes,
2122
clippy::semicolon_if_nothing_returned,

tests/expand/multifields/enum.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ enum EnumProjOwn<T, U> {
132132
clippy::redundant_pub_crate,
133133
clippy::single_char_lifetime_names,
134134
clippy::type_repetition_in_bounds,
135+
clippy::elidable_lifetime_names,
135136
clippy::missing_const_for_fn,
136137
clippy::needless_lifetimes,
137138
clippy::semicolon_if_nothing_returned,

tests/expand/multifields/struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct Struct<T, U> {
2323
clippy::redundant_pub_crate,
2424
clippy::single_char_lifetime_names,
2525
clippy::type_repetition_in_bounds,
26+
clippy::elidable_lifetime_names,
2627
clippy::missing_const_for_fn,
2728
clippy::needless_lifetimes,
2829
clippy::semicolon_if_nothing_returned,

tests/expand/multifields/tuple_struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct TupleStruct<T, U>(#[pin] T, #[pin] T, U, U);
1616
clippy::redundant_pub_crate,
1717
clippy::single_char_lifetime_names,
1818
clippy::type_repetition_in_bounds,
19+
clippy::elidable_lifetime_names,
1920
clippy::missing_const_for_fn,
2021
clippy::needless_lifetimes,
2122
clippy::semicolon_if_nothing_returned,

tests/expand/naming/enum-all.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ enum ProjOwn<T, U> {
9999
clippy::redundant_pub_crate,
100100
clippy::single_char_lifetime_names,
101101
clippy::type_repetition_in_bounds,
102+
clippy::elidable_lifetime_names,
102103
clippy::missing_const_for_fn,
103104
clippy::needless_lifetimes,
104105
clippy::semicolon_if_nothing_returned,

tests/expand/naming/enum-mut.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ where
4949
clippy::redundant_pub_crate,
5050
clippy::single_char_lifetime_names,
5151
clippy::type_repetition_in_bounds,
52+
clippy::elidable_lifetime_names,
5253
clippy::missing_const_for_fn,
5354
clippy::needless_lifetimes,
5455
clippy::semicolon_if_nothing_returned,

tests/expand/naming/enum-none.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ enum Enum<T, U> {
2020
clippy::redundant_pub_crate,
2121
clippy::single_char_lifetime_names,
2222
clippy::type_repetition_in_bounds,
23+
clippy::elidable_lifetime_names,
2324
clippy::missing_const_for_fn,
2425
clippy::needless_lifetimes,
2526
clippy::semicolon_if_nothing_returned,

tests/expand/naming/enum-own.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ enum ProjOwn<T, U> {
4444
clippy::redundant_pub_crate,
4545
clippy::single_char_lifetime_names,
4646
clippy::type_repetition_in_bounds,
47+
clippy::elidable_lifetime_names,
4748
clippy::missing_const_for_fn,
4849
clippy::needless_lifetimes,
4950
clippy::semicolon_if_nothing_returned,

tests/expand/naming/enum-ref.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ where
4646
clippy::redundant_pub_crate,
4747
clippy::single_char_lifetime_names,
4848
clippy::type_repetition_in_bounds,
49+
clippy::elidable_lifetime_names,
4950
clippy::missing_const_for_fn,
5051
clippy::needless_lifetimes,
5152
clippy::semicolon_if_nothing_returned,

tests/expand/naming/struct-all.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ struct ProjOwn<T, U> {
9191
clippy::redundant_pub_crate,
9292
clippy::single_char_lifetime_names,
9393
clippy::type_repetition_in_bounds,
94+
clippy::elidable_lifetime_names,
9495
clippy::missing_const_for_fn,
9596
clippy::needless_lifetimes,
9697
clippy::semicolon_if_nothing_returned,

tests/expand/naming/struct-mut.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ where
4545
clippy::redundant_pub_crate,
4646
clippy::single_char_lifetime_names,
4747
clippy::type_repetition_in_bounds,
48+
clippy::elidable_lifetime_names,
4849
clippy::missing_const_for_fn,
4950
clippy::needless_lifetimes,
5051
clippy::semicolon_if_nothing_returned,

tests/expand/naming/struct-none.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ struct Struct<T, U> {
2020
clippy::redundant_pub_crate,
2121
clippy::single_char_lifetime_names,
2222
clippy::type_repetition_in_bounds,
23+
clippy::elidable_lifetime_names,
2324
clippy::missing_const_for_fn,
2425
clippy::needless_lifetimes,
2526
clippy::semicolon_if_nothing_returned,

tests/expand/naming/struct-own.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ struct ProjOwn<T, U> {
4141
clippy::redundant_pub_crate,
4242
clippy::single_char_lifetime_names,
4343
clippy::type_repetition_in_bounds,
44+
clippy::elidable_lifetime_names,
4445
clippy::missing_const_for_fn,
4546
clippy::needless_lifetimes,
4647
clippy::semicolon_if_nothing_returned,

tests/expand/naming/struct-ref.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ where
4545
clippy::redundant_pub_crate,
4646
clippy::single_char_lifetime_names,
4747
clippy::type_repetition_in_bounds,
48+
clippy::elidable_lifetime_names,
4849
clippy::missing_const_for_fn,
4950
clippy::needless_lifetimes,
5051
clippy::semicolon_if_nothing_returned,

tests/expand/naming/tuple_struct-all.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ struct ProjOwn<T, U>(::pin_project::__private::PhantomData<T>, U);
8282
clippy::redundant_pub_crate,
8383
clippy::single_char_lifetime_names,
8484
clippy::type_repetition_in_bounds,
85+
clippy::elidable_lifetime_names,
8586
clippy::missing_const_for_fn,
8687
clippy::needless_lifetimes,
8788
clippy::semicolon_if_nothing_returned,

tests/expand/naming/tuple_struct-mut.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ where
4040
clippy::redundant_pub_crate,
4141
clippy::single_char_lifetime_names,
4242
clippy::type_repetition_in_bounds,
43+
clippy::elidable_lifetime_names,
4344
clippy::missing_const_for_fn,
4445
clippy::needless_lifetimes,
4546
clippy::semicolon_if_nothing_returned,

tests/expand/naming/tuple_struct-none.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct TupleStruct<T, U>(#[pin] T, U);
1616
clippy::redundant_pub_crate,
1717
clippy::single_char_lifetime_names,
1818
clippy::type_repetition_in_bounds,
19+
clippy::elidable_lifetime_names,
1920
clippy::missing_const_for_fn,
2021
clippy::needless_lifetimes,
2122
clippy::semicolon_if_nothing_returned,

tests/expand/naming/tuple_struct-own.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct ProjOwn<T, U>(::pin_project::__private::PhantomData<T>, U);
3434
clippy::redundant_pub_crate,
3535
clippy::single_char_lifetime_names,
3636
clippy::type_repetition_in_bounds,
37+
clippy::elidable_lifetime_names,
3738
clippy::missing_const_for_fn,
3839
clippy::needless_lifetimes,
3940
clippy::semicolon_if_nothing_returned,

tests/expand/naming/tuple_struct-ref.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ where
4040
clippy::redundant_pub_crate,
4141
clippy::single_char_lifetime_names,
4242
clippy::type_repetition_in_bounds,
43+
clippy::elidable_lifetime_names,
4344
clippy::missing_const_for_fn,
4445
clippy::needless_lifetimes,
4546
clippy::semicolon_if_nothing_returned,

tests/expand/not_unpin/enum.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ where
7575
clippy::redundant_pub_crate,
7676
clippy::single_char_lifetime_names,
7777
clippy::type_repetition_in_bounds,
78+
clippy::elidable_lifetime_names,
7879
clippy::missing_const_for_fn,
7980
clippy::needless_lifetimes,
8081
clippy::semicolon_if_nothing_returned,

tests/expand/not_unpin/struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ struct Struct<T, U> {
2020
clippy::redundant_pub_crate,
2121
clippy::single_char_lifetime_names,
2222
clippy::type_repetition_in_bounds,
23+
clippy::elidable_lifetime_names,
2324
clippy::missing_const_for_fn,
2425
clippy::needless_lifetimes,
2526
clippy::semicolon_if_nothing_returned,

tests/expand/not_unpin/tuple_struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct TupleStruct<T, U>(#[pin] T, U);
1616
clippy::redundant_pub_crate,
1717
clippy::single_char_lifetime_names,
1818
clippy::type_repetition_in_bounds,
19+
clippy::elidable_lifetime_names,
1920
clippy::missing_const_for_fn,
2021
clippy::needless_lifetimes,
2122
clippy::semicolon_if_nothing_returned,

tests/expand/pinned_drop/enum.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ where
7676
clippy::redundant_pub_crate,
7777
clippy::single_char_lifetime_names,
7878
clippy::type_repetition_in_bounds,
79+
clippy::elidable_lifetime_names,
7980
clippy::missing_const_for_fn,
8081
clippy::needless_lifetimes,
8182
clippy::semicolon_if_nothing_returned,

tests/expand/pinned_drop/struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct Struct<T, U> {
2121
clippy::redundant_pub_crate,
2222
clippy::single_char_lifetime_names,
2323
clippy::type_repetition_in_bounds,
24+
clippy::elidable_lifetime_names,
2425
clippy::missing_const_for_fn,
2526
clippy::needless_lifetimes,
2627
clippy::semicolon_if_nothing_returned,

tests/expand/pinned_drop/tuple_struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct TupleStruct<T, U>(#[pin] T, U);
1717
clippy::redundant_pub_crate,
1818
clippy::single_char_lifetime_names,
1919
clippy::type_repetition_in_bounds,
20+
clippy::elidable_lifetime_names,
2021
clippy::missing_const_for_fn,
2122
clippy::needless_lifetimes,
2223
clippy::semicolon_if_nothing_returned,

tests/expand/project_replace/enum.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ enum EnumProjOwn<T, U> {
4444
clippy::redundant_pub_crate,
4545
clippy::single_char_lifetime_names,
4646
clippy::type_repetition_in_bounds,
47+
clippy::elidable_lifetime_names,
4748
clippy::missing_const_for_fn,
4849
clippy::needless_lifetimes,
4950
clippy::semicolon_if_nothing_returned,

tests/expand/project_replace/struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ struct Struct<T, U> {
2020
clippy::redundant_pub_crate,
2121
clippy::single_char_lifetime_names,
2222
clippy::type_repetition_in_bounds,
23+
clippy::elidable_lifetime_names,
2324
clippy::missing_const_for_fn,
2425
clippy::needless_lifetimes,
2526
clippy::semicolon_if_nothing_returned,

tests/expand/project_replace/tuple_struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct TupleStruct<T, U>(#[pin] T, U);
1616
clippy::redundant_pub_crate,
1717
clippy::single_char_lifetime_names,
1818
clippy::type_repetition_in_bounds,
19+
clippy::elidable_lifetime_names,
1920
clippy::missing_const_for_fn,
2021
clippy::needless_lifetimes,
2122
clippy::semicolon_if_nothing_returned,

tests/expand/pub/enum.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ where
7575
clippy::redundant_pub_crate,
7676
clippy::single_char_lifetime_names,
7777
clippy::type_repetition_in_bounds,
78+
clippy::elidable_lifetime_names,
7879
clippy::missing_const_for_fn,
7980
clippy::needless_lifetimes,
8081
clippy::semicolon_if_nothing_returned,

tests/expand/pub/struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub struct Struct<T, U> {
2020
clippy::redundant_pub_crate,
2121
clippy::single_char_lifetime_names,
2222
clippy::type_repetition_in_bounds,
23+
clippy::elidable_lifetime_names,
2324
clippy::missing_const_for_fn,
2425
clippy::needless_lifetimes,
2526
clippy::semicolon_if_nothing_returned,

tests/expand/pub/tuple_struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub struct TupleStruct<T, U>(#[pin] pub T, pub U);
1616
clippy::redundant_pub_crate,
1717
clippy::single_char_lifetime_names,
1818
clippy::type_repetition_in_bounds,
19+
clippy::elidable_lifetime_names,
1920
clippy::missing_const_for_fn,
2021
clippy::needless_lifetimes,
2122
clippy::semicolon_if_nothing_returned,

tests/expand/unsafe_unpin/enum.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ where
7575
clippy::redundant_pub_crate,
7676
clippy::single_char_lifetime_names,
7777
clippy::type_repetition_in_bounds,
78+
clippy::elidable_lifetime_names,
7879
clippy::missing_const_for_fn,
7980
clippy::needless_lifetimes,
8081
clippy::semicolon_if_nothing_returned,

tests/expand/unsafe_unpin/struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ struct Struct<T, U> {
2020
clippy::redundant_pub_crate,
2121
clippy::single_char_lifetime_names,
2222
clippy::type_repetition_in_bounds,
23+
clippy::elidable_lifetime_names,
2324
clippy::missing_const_for_fn,
2425
clippy::needless_lifetimes,
2526
clippy::semicolon_if_nothing_returned,

tests/expand/unsafe_unpin/tuple_struct.expanded.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct TupleStruct<T, U>(#[pin] T, U);
1616
clippy::redundant_pub_crate,
1717
clippy::single_char_lifetime_names,
1818
clippy::type_repetition_in_bounds,
19+
clippy::elidable_lifetime_names,
1920
clippy::missing_const_for_fn,
2021
clippy::needless_lifetimes,
2122
clippy::semicolon_if_nothing_returned,

0 commit comments

Comments
 (0)