Skip to content

Commit 05d89cc

Browse files
committed
move @ matches before other patterns
1 parent b88d087 commit 05d89cc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/macros.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,6 @@ macro_rules! e {
221221
// FIXME(ctest): ctest doesn't like `?` kleenes, `literal` fragments, or `$crate`. See inline
222222
// comments for what eventually should be fixed.
223223
macro_rules! c_enum {
224-
(
225-
$(#[repr($repr:ty)])* /* ? */
226-
$ty_name:ident {
227-
$($variant:ident $(= $value:tt /* literal */)* /* ? */,)+
228-
}
229-
) => {
230-
pub type $ty_name = c_enum!(@_ty $($repr)*);
231-
c_enum!(@one; $ty_name; 0; $($variant $(= $value)*,)+);
232-
};
233224
// Matcher for a single variant
234225
(@one; $_ty_name:ident; $_idx:expr;) => {};
235226
(
@@ -252,6 +243,15 @@ macro_rules! c_enum {
252243
// Use a specific type if provided, otherwise default to `c_uint`
253244
(@_ty $repr:ty) => { $repr };
254245
(@_ty) => { /* $crate */ crate::c_uint };
246+
(
247+
$(#[repr($repr:ty)])* /* ? */
248+
$ty_name:ident {
249+
$($variant:ident $(= $value:tt /* literal */)* /* ? */,)+
250+
}
251+
) => {
252+
pub type $ty_name = c_enum!(@_ty $($repr)*);
253+
c_enum!(@one; $ty_name; 0; $($variant $(= $value)*,)+);
254+
};
255255
}
256256

257257
// This is a pretty horrible hack to allow us to conditionally mark some functions as 'const',

0 commit comments

Comments
 (0)