Skip to content
Myr

Ignore dead code lint in tests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

New in nightly-2024-03-24 from https://github.com/rust-lang/rust/pull/119552. warning: fields `nested` and `string` are never read --> test_suite/tests/regression/issue2371.rs:10:9 | 8 | Flatten { | ------- fields in this variant 9 | #[serde(flatten)] 10 | nested: Nested, | ^^^^^^ 11 | string: &'static str, | ^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: fields `nested` and `string` are never read --> test_suite/tests/regression/issue2371.rs:20:9 | 18 | Flatten { | ------- fields in this variant 19 | #[serde(flatten)] 20 | nested: Nested, | ^^^^^^ 21 | string: &'static str, | ^^^^^^ warning: fields `nested` and `string` are never read --> test_suite/tests/regression/issue2371.rs:30:9 | 28 | Flatten { | ------- fields in this variant 29 | #[serde(flatten)] 30 | nested: Nested, | ^^^^^^ 31 | string: &'static str, | ^^^^^^ warning: fields `nested` and `string` are never read --> test_suite/tests/regression/issue2371.rs:40:9 | 38 | Flatten { | ------- fields in this variant 39 | #[serde(flatten)] 40 | nested: Nested, | ^^^^^^ 41 | string: &'static str, | ^^^^^^ warning: field `0` is never read --> test_suite/tests/test_gen.rs:690:33 | 690 | Single(#[serde(borrow)] RelObject<'a>), | ------ ^^^^^^^^^^^^^ | | | field in this variant | = 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 | 690 | Single(#[serde(borrow)] ()), | ~~ warning: field `0` is never read --> test_suite/tests/test_gen.rs:691:31 | 691 | Many(#[serde(borrow)] Vec<RelObject<'a>>), | ---- ^^^^^^^^^^^^^^^^^^ | | | 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 | 691 | Many(#[serde(borrow)] ()), | ~~

authored by David Tolnay · committed by David Tolnay · parent 9f8c579 · Browse files · 2 files+18 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+18 added−2 removed

  • tests:+18 added−2 removed

2 files+18 added−2 removed

modified:test_suite/tests/regression/issue2371.rs+8 added
5 unmodified lines
6#[derive(Deserialize)]7pub enum ExternallyTagged {8 Flatten {9 #[serde(flatten)]10 #[allow(dead_code)]11 nested: Nested,12 #[allow(dead_code)]13 string: &'static str,14 },15}16
1 unmodified line
18#[serde(tag = "tag")]19pub enum InternallyTagged {20 Flatten {21 #[serde(flatten)]22 #[allow(dead_code)]23 nested: Nested,24 #[allow(dead_code)]25 string: &'static str,26 },27}28
1 unmodified line
30#[serde(tag = "tag", content = "content")]31pub enum AdjacentlyTagged {32 Flatten {33 #[serde(flatten)]34 #[allow(dead_code)]35 nested: Nested,36 #[allow(dead_code)]37 string: &'static str,38 },39}40
1 unmodified line
42#[serde(untagged)]43pub enum UntaggedWorkaround {44 Flatten {45 #[serde(flatten)]46 #[allow(dead_code)]47 nested: Nested,48 #[allow(dead_code)]49 string: &'static str,50 },51}
modified:test_suite/tests/test_gen.rs+10 added-2 removed
685 unmodified lines
686687 #[derive(Deserialize)]688 #[serde(untagged)]689 pub enum UntaggedWithBorrow<'a> {690 Single(#[serde(borrow)] RelObject<'a>),691 Many(#[serde(borrow)] Vec<RelObject<'a>>),690 Single(691 #[serde(borrow)]692 #[allow(dead_code)]693 RelObject<'a>,694 ),695 Many(696 #[serde(borrow)]697 #[allow(dead_code)]698 Vec<RelObject<'a>>,699 ),700 }701702 #[derive(Deserialize)]703 struct RelObject<'a> {
220 unmodified lines