File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -222,29 +222,30 @@ macro_rules! e {
222
222
/// purpose is to calculate the correct enum values.
223
223
///
224
224
/// See <https://github.com/rust-lang/libc/issues/4419> for more.
225
- // FIXME(ctest): ctest doesn't recognize the `literal` fragment specifier.
225
+ // FIXME(ctest): ctest doesn't recognize the `literal` fragment specifier or the `?` kleene. See
226
+ // inline comments for how this should be updated once ctest is fixed.
226
227
macro_rules! c_enum {
227
228
(
228
- $( #[ repr( $repr: ty) ] ) ?
229
+ $( #[ repr( $repr: ty) ] ) * /* ? */
229
230
enum $ty_name: ident {
230
- $( $variant: ident $( = $value: expr /* literal */ ) ? , ) +
231
+ $( $variant: ident $( = $value: expr /* literal */ ) * /* ? */ , ) +
231
232
}
232
233
) => {
233
- pub type $ty_name = c_enum!( @ty $( $repr) ? ) ;
234
- c_enum!( @one; $ty_name; 0 ; $( $variant $( = $value) ? , ) +) ;
234
+ pub type $ty_name = c_enum!( @ty $( $repr) * ) ;
235
+ c_enum!( @one; $ty_name; 0 ; $( $variant $( = $value) * , ) +) ;
235
236
} ;
236
237
237
238
// Matcher for a single variant
238
239
( @one; $_ty_name: ident; $_idx: expr; ) => { } ;
239
240
(
240
241
@one; $ty_name: ident; $default_val: expr;
241
- $variant: ident $( = $value: expr /* literal */ ) ? ,
242
+ $variant: ident $( = $value: expr /* literal */ ) * /* ? */ ,
242
243
$( $tail: tt) *
243
244
) => {
244
245
pub const $variant: $ty_name = {
245
246
#[ allow( unused_variables) ]
246
247
let r = $default_val;
247
- $( let r = $value; ) ?
248
+ $( let r = $value; ) *
248
249
r
249
250
} ;
250
251
You can’t perform that action at this time.
0 commit comments