From c3df3372a18a7c0964b55bd495e52d666680a9c4 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 7 Aug 2024 18:17:50 -0700 Subject: [PATCH] Add test of flatten in enum error: collection is never read --> test_suite/tests/test_gen.rs:728:25 | 728 | #[derive(Serialize, Deserialize)] | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collection_is_never_read = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) --- test_suite/tests/test_gen.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test_suite/tests/test_gen.rs b/test_suite/tests/test_gen.rs index 0459691bb..0119584c3 100644 --- a/test_suite/tests/test_gen.rs +++ b/test_suite/tests/test_gen.rs @@ -725,6 +725,19 @@ fn test_gen() { flat: T, } + #[derive(Serialize, Deserialize)] + #[serde(untagged)] + pub enum Inner { + Builder { + s: T, + #[serde(flatten)] + o: T, + }, + Default { + s: T, + }, + } + // https://github.com/serde-rs/serde/issues/1804 #[derive(Serialize, Deserialize)] pub enum Message {