Fixed a compilefail test for flatten on enums
This commit is contained in:
parent
0fde3c2ee8
commit
3d647f4063
@ -45,9 +45,7 @@ fn check_getter(cx: &Ctxt, cont: &Container) {
|
||||
fn check_flatten(cx: &Ctxt, cont: &Container) {
|
||||
match cont.data {
|
||||
Data::Enum(_) => {
|
||||
if cont.attrs.has_flatten() {
|
||||
cx.error("#[serde(flatten)] is not supported on enums");
|
||||
}
|
||||
debug_assert!(!cont.attrs.has_flatten());
|
||||
}
|
||||
Data::Struct(_, _) => {
|
||||
for field in cont.data.all_fields() {
|
||||
|
@ -10,7 +10,7 @@
|
||||
extern crate serde_derive;
|
||||
|
||||
#[derive(Serialize)] //~ ERROR: proc-macro derive panicked
|
||||
//~^ HELP: #[serde(flatten] is not supported on enums
|
||||
//~^ HELP: unknown serde variant attribute `flatten`
|
||||
enum Foo {
|
||||
#[serde(flatten)]
|
||||
Foo {
|
||||
|
Loading…
x
Reference in New Issue
Block a user