@@ -148,11 +148,13 @@ pub(crate) fn encapsulate_config_for_enum(
148
148
149
149
let mut exclude = config. exclude . take ( ) . unwrap_or_default ( ) ;
150
150
151
- if exclude. is_empty ( ) {
151
+ let idents = macro_selection_config_for_enum ( & meta) ?. idents ;
152
+
153
+ if idents. is_empty ( ) {
152
154
return Err ( meta. error ( "expected list" ) ) ;
153
155
}
154
156
155
- exclude. extend_idents ( macro_selection_config_for_enum ( & meta ) ? . idents ) ;
157
+ exclude. extend_idents ( idents) ;
156
158
157
159
config. exclude = Some ( exclude) ;
158
160
} else {
@@ -172,7 +174,12 @@ pub(crate) fn config_for_enum(enum_item: &syn::ItemEnum) -> Result<EnumConfig, s
172
174
if meta. path . is_ident ( attr:: EXCLUDE ) {
173
175
// #[enumcapsulate(exclude(…))]
174
176
175
- // Ignored.
177
+ meta. parse_nested_meta ( |_meta| {
178
+ // Here we're not interested in any of the existing
179
+ // sub-attributes, but we need to parse the list anyway.
180
+
181
+ Ok ( ( ) )
182
+ } ) ?;
176
183
} else {
177
184
return Err ( meta. error ( "unrecognized attribute" ) ) ;
178
185
}
@@ -378,6 +385,7 @@ pub(crate) fn parse_idents_from_meta_list(
378
385
if lookahead. peek ( syn:: token:: Paren ) {
379
386
let content;
380
387
syn:: parenthesized!( content in meta. input) ;
388
+
381
389
let punctuated: Punctuated < syn:: Ident , syn:: Token ![ , ] > =
382
390
content. parse_terminated ( syn:: Ident :: parse, syn:: Token ![ , ] ) ?;
383
391
0 commit comments