Skip to content
Myr

Resolve new dead_code warnings in test suite

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

Bisects to https://github.com/rust-lang/rust/pull/141407. warning: struct `Struct` is never constructed --> test_suite/tests/test_gen.rs:803:16 | 803 | pub struct Struct { | ^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: function `vec_first_element` is never used --> test_suite/tests/test_gen.rs:885:4 | 885 | fn vec_first_element<T, S>(vec: &[T], serializer: S) -> StdResult<S::Ok, S::Error> | ^^^^^^^^^^^^^^^^^ warning: struct `S` is never constructed --> test_suite/tests/regression/issue2415.rs:5:12 | 5 | pub struct S; | ^ | = note: `#[warn(dead_code)]` on by default

authored by David Tolnay · committed by David Tolnay · parent da3998a · Browse files · 2 files+3 added−0 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+3 added−0 removed

  • tests:+3 added−0 removed

2 files+3 added−0 removed

modified:test_suite/tests/regression/issue2415.rs+1 added
1use serde_derive::Serialize;23#[derive(Serialize)]4#[serde()]5#[allow(dead_code)]6pub struct S;
modified:test_suite/tests/test_gen.rs+2 added
803 unmodified lines
804 #[serde(serialize_with = "vec_first_element")]805 pub vec: Vec<Self>,806 }807808 assert_ser::<Struct>();809810 #[derive(Deserialize)]811 #[serde(bound(deserialize = "[&'de str; N]: Copy"))]812 pub struct GenericUnitStruct<const N: usize>;813}
141 unmodified lines