From 2afe5b4ef9d0e89587ec564eadbc7583fd1f0673 Mon Sep 17 00:00:00 2001 From: Mingun Date: Sat, 10 Aug 2024 21:29:39 +0500 Subject: [PATCH] Add regression test for issue #2792 --- test_suite/tests/regression/issue2792.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test_suite/tests/regression/issue2792.rs diff --git a/test_suite/tests/regression/issue2792.rs b/test_suite/tests/regression/issue2792.rs new file mode 100644 index 00000000..13c0b710 --- /dev/null +++ b/test_suite/tests/regression/issue2792.rs @@ -0,0 +1,16 @@ +#![allow(dead_code)] // we do not read enum fields +use serde_derive::Deserialize; + +#[derive(Deserialize)] +#[serde(deny_unknown_fields)] +pub enum A { + B { + c: String, + }, + D { + #[serde(flatten)] + e: E, + }, +} +#[derive(Deserialize)] +pub struct E {}