Skip to content

Commit 6f1a8c3

Browse files
committed
Add FIXME to fix dead_code warning when using serde(remote)
warning: field `0` is never read --> test_suite/tests/test_remote.rs:143:24 | 143 | struct PrimitivePubDef(u8); | --------------- ^^ | | | field in this struct | = note: `#[warn(dead_code)]` on by default help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 143 | struct PrimitivePubDef(()); | ~~ warning: field `0` is never read --> test_suite/tests/test_remote.rs:162:20 | 162 | struct TuplePubDef(u8, #[serde(with = "UnitDef")] remote::Unit); | ----------- ^^ | | | field in this struct | help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 162 | struct TuplePubDef((), #[serde(with = "UnitDef")] remote::Unit); | ~~ warning: field `0` is never read --> test_suite/tests/test_remote.rs:200:13 | 200 | Variant(u8), | ------- ^^ | | | field in this variant | help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 200 | Variant(()), | ~~ error: field `0` is never read --> test_suite/tests/test_gen.rs:390:23 | 390 | struct StrDef<'a>(&'a str); | ------ ^^^^^^^ | | | field in this struct | note: the lint level is defined here --> test_suite/tests/test_gen.rs:5:9 | 5 | #![deny(warnings)] | ^^^^^^^^ = note: `#[deny(dead_code)]` implied by `#[deny(warnings)]` help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 390 | struct StrDef<'a>(()); | ~~
1 parent d883c94 commit 6f1a8c3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

test_suite/tests/test_gen.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ fn test_gen() {
387387

388388
#[derive(Serialize, Deserialize)]
389389
#[serde(remote = "Str")]
390+
#[allow(dead_code)] // FIXME
390391
struct StrDef<'a>(&'a str);
391392

392393
#[derive(Serialize, Deserialize)]

test_suite/tests/test_remote.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ struct PrimitivePrivDef(#[serde(getter = "remote::PrimitivePriv::get")] u8);
140140

141141
#[derive(Serialize, Deserialize)]
142142
#[serde(remote = "remote::PrimitivePub")]
143+
#[allow(dead_code)] // FIXME
143144
struct PrimitivePubDef(u8);
144145

145146
#[derive(Serialize, Deserialize)]
@@ -159,6 +160,7 @@ struct TuplePrivDef(
159160

160161
#[derive(Serialize, Deserialize)]
161162
#[serde(remote = "remote::TuplePub")]
163+
#[allow(dead_code)] // FIXME
162164
struct TuplePubDef(u8, #[serde(with = "UnitDef")] remote::Unit);
163165

164166
#[derive(Serialize, Deserialize)]
@@ -196,6 +198,7 @@ struct StructConcrete {
196198

197199
#[derive(Serialize, Deserialize)]
198200
#[serde(remote = "remote::EnumGeneric<u8>")]
201+
#[allow(dead_code)] // FIXME
199202
enum EnumConcrete {
200203
Variant(u8),
201204
}

0 commit comments

Comments
 (0)