Skip to content

Commit d2dbbf7

Browse files
committed
Ignore dead code lint in tests
New in nightly-2024-03-24 from rust-lang/rust#119552. warning: field `x` is never read --> tests/regression/issue795.rs:11:15 | 11 | Variant { x: u8 }, | ------- ^ | | | field in this variant | = note: `#[warn(dead_code)]` on by default warning: field `i` is never read --> tests/regression/issue845.rs:63:9 | 61 | pub struct Struct { | ------ field in this struct 62 | #[serde(deserialize_with = "deserialize_integer_or_string")] 63 | pub i: i64, | ^ | = note: `Struct` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
1 parent 8e7b37b commit d2dbbf7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/regression/issue795.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ use std::fmt;
88

99
#[derive(Debug)]
1010
pub enum Enum {
11-
Variant { x: u8 },
11+
Variant {
12+
#[allow(dead_code)]
13+
x: u8,
14+
},
1215
}
1316

1417
impl<'de> Deserialize<'de> for Enum {

tests/regression/issue845.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ where
6060
#[derive(Deserialize, Debug)]
6161
pub struct Struct {
6262
#[serde(deserialize_with = "deserialize_integer_or_string")]
63+
#[allow(dead_code)]
6364
pub i: i64,
6465
}
6566

0 commit comments

Comments
 (0)