Skip to content

Commit 947e04f

Browse files
committed
Suppress deprecated lint in generated code
1 parent e26e575 commit 947e04f

39 files changed

+226
-0
lines changed

CHANGELOG.md

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

1111
## [Unreleased]
1212

13+
- Suppress `deprecated` lint in generated code.
14+
1315
## [1.0.4] - 2021-01-09
1416

1517
- [Suppress `clippy::ref_option_ref` lint in generated code.](https://github.com/taiki-e/pin-project/pull/308)

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

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ impl GenerateTokens {
102102
fn global_allowed_lints() -> TokenStream {
103103
quote! {
104104
#[allow(box_pointers)] // This lint warns use of the `Box` type.
105+
#[allow(deprecated)]
105106
#[allow(explicit_outlives_requirements)] // https://github.com/rust-lang/rust/issues/60993
106107
#[allow(single_use_lifetimes)] // https://github.com/rust-lang/rust/issues/55058
107108
#[allow(unreachable_pub)] // This lint warns `pub` field in private struct.

tests/expand/default/enum.expanded.rs

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ enum Enum<T, U> {
1010
Unit,
1111
}
1212
#[allow(box_pointers)]
13+
#[allow(deprecated)]
1314
#[allow(explicit_outlives_requirements)]
1415
#[allow(single_use_lifetimes)]
1516
#[allow(unreachable_pub)]
@@ -31,6 +32,7 @@ where
3132
Unit,
3233
}
3334
#[allow(box_pointers)]
35+
#[allow(deprecated)]
3436
#[allow(explicit_outlives_requirements)]
3537
#[allow(single_use_lifetimes)]
3638
#[allow(unreachable_pub)]
@@ -52,6 +54,7 @@ where
5254
Unit,
5355
}
5456
#[allow(box_pointers)]
57+
#[allow(deprecated)]
5558
#[allow(explicit_outlives_requirements)]
5659
#[allow(single_use_lifetimes)]
5760
#[allow(unreachable_pub)]

tests/expand/default/struct.expanded.rs

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ struct Struct<T, U> {
66
unpinned: U,
77
}
88
#[allow(box_pointers)]
9+
#[allow(deprecated)]
910
#[allow(explicit_outlives_requirements)]
1011
#[allow(single_use_lifetimes)]
1112
#[allow(unreachable_pub)]
@@ -15,6 +16,7 @@ struct Struct<T, U> {
1516
#[allow(clippy::used_underscore_binding)]
1617
const _: () = {
1718
#[allow(box_pointers)]
19+
#[allow(deprecated)]
1820
#[allow(explicit_outlives_requirements)]
1921
#[allow(single_use_lifetimes)]
2022
#[allow(unreachable_pub)]
@@ -32,6 +34,7 @@ const _: () = {
3234
unpinned: &'pin mut (U),
3335
}
3436
#[allow(box_pointers)]
37+
#[allow(deprecated)]
3538
#[allow(explicit_outlives_requirements)]
3639
#[allow(single_use_lifetimes)]
3740
#[allow(unreachable_pub)]

tests/expand/default/tuple_struct.expanded.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use pin_project::pin_project;
22
#[pin(__private())]
33
struct TupleStruct<T, U>(#[pin] T, U);
44
#[allow(box_pointers)]
5+
#[allow(deprecated)]
56
#[allow(explicit_outlives_requirements)]
67
#[allow(single_use_lifetimes)]
78
#[allow(unreachable_pub)]
@@ -11,6 +12,7 @@ struct TupleStruct<T, U>(#[pin] T, U);
1112
#[allow(clippy::used_underscore_binding)]
1213
const _: () = {
1314
#[allow(box_pointers)]
15+
#[allow(deprecated)]
1416
#[allow(explicit_outlives_requirements)]
1517
#[allow(single_use_lifetimes)]
1618
#[allow(unreachable_pub)]
@@ -27,6 +29,7 @@ const _: () = {
2729
where
2830
TupleStruct<T, U>: 'pin;
2931
#[allow(box_pointers)]
32+
#[allow(deprecated)]
3033
#[allow(explicit_outlives_requirements)]
3134
#[allow(single_use_lifetimes)]
3235
#[allow(unreachable_pub)]

tests/expand/multifields/enum.expanded.rs

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ enum Enum<T, U> {
1313
Unit,
1414
}
1515
#[allow(box_pointers)]
16+
#[allow(deprecated)]
1617
#[allow(explicit_outlives_requirements)]
1718
#[allow(single_use_lifetimes)]
1819
#[allow(unreachable_pub)]
@@ -41,6 +42,7 @@ where
4142
Unit,
4243
}
4344
#[allow(box_pointers)]
45+
#[allow(deprecated)]
4446
#[allow(explicit_outlives_requirements)]
4547
#[allow(single_use_lifetimes)]
4648
#[allow(unreachable_pub)]
@@ -69,6 +71,7 @@ where
6971
Unit,
7072
}
7173
#[allow(box_pointers)]
74+
#[allow(deprecated)]
7275
#[allow(explicit_outlives_requirements)]
7376
#[allow(single_use_lifetimes)]
7477
#[allow(unreachable_pub)]
@@ -94,6 +97,7 @@ enum EnumProjOwn<T, U> {
9497
Unit,
9598
}
9699
#[allow(box_pointers)]
100+
#[allow(deprecated)]
97101
#[allow(explicit_outlives_requirements)]
98102
#[allow(single_use_lifetimes)]
99103
#[allow(unreachable_pub)]

tests/expand/multifields/struct.expanded.rs

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ struct Struct<T, U> {
99
unpinned2: U,
1010
}
1111
#[allow(box_pointers)]
12+
#[allow(deprecated)]
1213
#[allow(explicit_outlives_requirements)]
1314
#[allow(single_use_lifetimes)]
1415
#[allow(unreachable_pub)]
@@ -18,6 +19,7 @@ struct Struct<T, U> {
1819
#[allow(clippy::used_underscore_binding)]
1920
const _: () = {
2021
#[allow(box_pointers)]
22+
#[allow(deprecated)]
2123
#[allow(explicit_outlives_requirements)]
2224
#[allow(single_use_lifetimes)]
2325
#[allow(unreachable_pub)]
@@ -37,6 +39,7 @@ const _: () = {
3739
unpinned2: &'pin mut (U),
3840
}
3941
#[allow(box_pointers)]
42+
#[allow(deprecated)]
4043
#[allow(explicit_outlives_requirements)]
4144
#[allow(single_use_lifetimes)]
4245
#[allow(unreachable_pub)]
@@ -56,6 +59,7 @@ const _: () = {
5659
unpinned2: &'pin (U),
5760
}
5861
#[allow(box_pointers)]
62+
#[allow(deprecated)]
5963
#[allow(explicit_outlives_requirements)]
6064
#[allow(single_use_lifetimes)]
6165
#[allow(unreachable_pub)]

tests/expand/multifields/tuple_struct.expanded.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use pin_project::pin_project;
22
#[pin(__private(project_replace))]
33
struct TupleStruct<T, U>(#[pin] T, #[pin] T, U, U);
44
#[allow(box_pointers)]
5+
#[allow(deprecated)]
56
#[allow(explicit_outlives_requirements)]
67
#[allow(single_use_lifetimes)]
78
#[allow(unreachable_pub)]
@@ -11,6 +12,7 @@ struct TupleStruct<T, U>(#[pin] T, #[pin] T, U, U);
1112
#[allow(clippy::used_underscore_binding)]
1213
const _: () = {
1314
#[allow(box_pointers)]
15+
#[allow(deprecated)]
1416
#[allow(explicit_outlives_requirements)]
1517
#[allow(single_use_lifetimes)]
1618
#[allow(unreachable_pub)]
@@ -29,6 +31,7 @@ const _: () = {
2931
where
3032
TupleStruct<T, U>: 'pin;
3133
#[allow(box_pointers)]
34+
#[allow(deprecated)]
3235
#[allow(explicit_outlives_requirements)]
3336
#[allow(single_use_lifetimes)]
3437
#[allow(unreachable_pub)]
@@ -47,6 +50,7 @@ const _: () = {
4750
where
4851
TupleStruct<T, U>: 'pin;
4952
#[allow(box_pointers)]
53+
#[allow(deprecated)]
5054
#[allow(explicit_outlives_requirements)]
5155
#[allow(single_use_lifetimes)]
5256
#[allow(unreachable_pub)]

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

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ enum Enum<T, U> {
1010
Unit,
1111
}
1212
#[allow(box_pointers)]
13+
#[allow(deprecated)]
1314
#[allow(explicit_outlives_requirements)]
1415
#[allow(single_use_lifetimes)]
1516
#[allow(unreachable_pub)]
@@ -31,6 +32,7 @@ where
3132
Unit,
3233
}
3334
#[allow(box_pointers)]
35+
#[allow(deprecated)]
3436
#[allow(explicit_outlives_requirements)]
3537
#[allow(single_use_lifetimes)]
3638
#[allow(unreachable_pub)]
@@ -52,6 +54,7 @@ where
5254
Unit,
5355
}
5456
#[allow(box_pointers)]
57+
#[allow(deprecated)]
5558
#[allow(explicit_outlives_requirements)]
5659
#[allow(single_use_lifetimes)]
5760
#[allow(unreachable_pub)]
@@ -70,6 +73,7 @@ enum ProjOwn<T, U> {
7073
Unit,
7174
}
7275
#[allow(box_pointers)]
76+
#[allow(deprecated)]
7377
#[allow(explicit_outlives_requirements)]
7478
#[allow(single_use_lifetimes)]
7579
#[allow(unreachable_pub)]

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

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ enum Enum<T, U> {
1010
Unit,
1111
}
1212
#[allow(box_pointers)]
13+
#[allow(deprecated)]
1314
#[allow(explicit_outlives_requirements)]
1415
#[allow(single_use_lifetimes)]
1516
#[allow(unreachable_pub)]
@@ -31,6 +32,7 @@ where
3132
Unit,
3233
}
3334
#[allow(box_pointers)]
35+
#[allow(deprecated)]
3436
#[allow(explicit_outlives_requirements)]
3537
#[allow(single_use_lifetimes)]
3638
#[allow(unreachable_pub)]

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

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ enum Enum<T, U> {
1010
Unit,
1111
}
1212
#[allow(box_pointers)]
13+
#[allow(deprecated)]
1314
#[allow(explicit_outlives_requirements)]
1415
#[allow(single_use_lifetimes)]
1516
#[allow(unreachable_pub)]

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

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ enum Enum<T, U> {
1010
Unit,
1111
}
1212
#[allow(box_pointers)]
13+
#[allow(deprecated)]
1314
#[allow(explicit_outlives_requirements)]
1415
#[allow(single_use_lifetimes)]
1516
#[allow(unreachable_pub)]
@@ -28,6 +29,7 @@ enum ProjOwn<T, U> {
2829
Unit,
2930
}
3031
#[allow(box_pointers)]
32+
#[allow(deprecated)]
3133
#[allow(explicit_outlives_requirements)]
3234
#[allow(single_use_lifetimes)]
3335
#[allow(unreachable_pub)]

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

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ enum Enum<T, U> {
1010
Unit,
1111
}
1212
#[allow(box_pointers)]
13+
#[allow(deprecated)]
1314
#[allow(explicit_outlives_requirements)]
1415
#[allow(single_use_lifetimes)]
1516
#[allow(unreachable_pub)]
@@ -31,6 +32,7 @@ where
3132
Unit,
3233
}
3334
#[allow(box_pointers)]
35+
#[allow(deprecated)]
3436
#[allow(explicit_outlives_requirements)]
3537
#[allow(single_use_lifetimes)]
3638
#[allow(unreachable_pub)]

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

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ struct Struct<T, U> {
66
unpinned: U,
77
}
88
#[allow(box_pointers)]
9+
#[allow(deprecated)]
910
#[allow(explicit_outlives_requirements)]
1011
#[allow(single_use_lifetimes)]
1112
#[allow(unreachable_pub)]
@@ -23,6 +24,7 @@ where
2324
unpinned: &'pin mut (U),
2425
}
2526
#[allow(box_pointers)]
27+
#[allow(deprecated)]
2628
#[allow(explicit_outlives_requirements)]
2729
#[allow(single_use_lifetimes)]
2830
#[allow(unreachable_pub)]
@@ -40,6 +42,7 @@ where
4042
unpinned: &'pin (U),
4143
}
4244
#[allow(box_pointers)]
45+
#[allow(deprecated)]
4346
#[allow(explicit_outlives_requirements)]
4447
#[allow(single_use_lifetimes)]
4548
#[allow(unreachable_pub)]
@@ -52,6 +55,7 @@ struct ProjOwn<T, U> {
5255
unpinned: U,
5356
}
5457
#[allow(box_pointers)]
58+
#[allow(deprecated)]
5559
#[allow(explicit_outlives_requirements)]
5660
#[allow(single_use_lifetimes)]
5761
#[allow(unreachable_pub)]

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

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ struct Struct<T, U> {
66
unpinned: U,
77
}
88
#[allow(box_pointers)]
9+
#[allow(deprecated)]
910
#[allow(explicit_outlives_requirements)]
1011
#[allow(single_use_lifetimes)]
1112
#[allow(unreachable_pub)]
@@ -23,6 +24,7 @@ where
2324
unpinned: &'pin mut (U),
2425
}
2526
#[allow(box_pointers)]
27+
#[allow(deprecated)]
2628
#[allow(explicit_outlives_requirements)]
2729
#[allow(single_use_lifetimes)]
2830
#[allow(unreachable_pub)]
@@ -32,6 +34,7 @@ where
3234
#[allow(clippy::used_underscore_binding)]
3335
const _: () = {
3436
#[allow(box_pointers)]
37+
#[allow(deprecated)]
3538
#[allow(explicit_outlives_requirements)]
3639
#[allow(single_use_lifetimes)]
3740
#[allow(unreachable_pub)]

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

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ struct Struct<T, U> {
66
unpinned: U,
77
}
88
#[allow(box_pointers)]
9+
#[allow(deprecated)]
910
#[allow(explicit_outlives_requirements)]
1011
#[allow(single_use_lifetimes)]
1112
#[allow(unreachable_pub)]
@@ -15,6 +16,7 @@ struct Struct<T, U> {
1516
#[allow(clippy::used_underscore_binding)]
1617
const _: () = {
1718
#[allow(box_pointers)]
19+
#[allow(deprecated)]
1820
#[allow(explicit_outlives_requirements)]
1921
#[allow(single_use_lifetimes)]
2022
#[allow(unreachable_pub)]
@@ -32,6 +34,7 @@ const _: () = {
3234
unpinned: &'pin mut (U),
3335
}
3436
#[allow(box_pointers)]
37+
#[allow(deprecated)]
3538
#[allow(explicit_outlives_requirements)]
3639
#[allow(single_use_lifetimes)]
3740
#[allow(unreachable_pub)]

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

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ struct Struct<T, U> {
66
unpinned: U,
77
}
88
#[allow(box_pointers)]
9+
#[allow(deprecated)]
910
#[allow(explicit_outlives_requirements)]
1011
#[allow(single_use_lifetimes)]
1112
#[allow(unreachable_pub)]
@@ -18,6 +19,7 @@ struct ProjOwn<T, U> {
1819
unpinned: U,
1920
}
2021
#[allow(box_pointers)]
22+
#[allow(deprecated)]
2123
#[allow(explicit_outlives_requirements)]
2224
#[allow(single_use_lifetimes)]
2325
#[allow(unreachable_pub)]
@@ -27,6 +29,7 @@ struct ProjOwn<T, U> {
2729
#[allow(clippy::used_underscore_binding)]
2830
const _: () = {
2931
#[allow(box_pointers)]
32+
#[allow(deprecated)]
3033
#[allow(explicit_outlives_requirements)]
3134
#[allow(single_use_lifetimes)]
3235
#[allow(unreachable_pub)]
@@ -44,6 +47,7 @@ const _: () = {
4447
unpinned: &'pin mut (U),
4548
}
4649
#[allow(box_pointers)]
50+
#[allow(deprecated)]
4751
#[allow(explicit_outlives_requirements)]
4852
#[allow(single_use_lifetimes)]
4953
#[allow(unreachable_pub)]

0 commit comments

Comments
 (0)