From b6d2d984d8bf745cc20030f657290032337867da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= Date: Mon, 28 Sep 2020 00:03:02 +0200 Subject: [PATCH] Support #[repr(u128)] --- enumflags_derive/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/enumflags_derive/src/lib.rs b/enumflags_derive/src/lib.rs index dfc44b9..278c9e7 100644 --- a/enumflags_derive/src/lib.rs +++ b/enumflags_derive/src/lib.rs @@ -14,7 +14,7 @@ struct Flag { } enum FlagValue { - Literal(u64), + Literal(u128), Deferred, Inferred, } @@ -48,7 +48,7 @@ pub fn bitflags_internal( } /// Try to evaluate the expression given. -fn fold_expr(expr: &syn::Expr) -> Option { +fn fold_expr(expr: &syn::Expr) -> Option { use syn::Expr; match expr { Expr::Lit(ref expr_lit) => { @@ -163,9 +163,9 @@ fn check_flag( #[doc(hidden)] const #assertion_name: <<[(); ( - (#type_name::#variant_name as u64).wrapping_sub(1) & - (#type_name::#variant_name as u64) == 0 && - (#type_name::#variant_name as u64) != 0 + (#type_name::#variant_name as u128).wrapping_sub(1) & + (#type_name::#variant_name as u128) == 0 && + (#type_name::#variant_name as u128) != 0 ) as usize] as enumflags2::_internal::AssertionHelper> ::Status as enumflags2::_internal::ExactlyOneBitSet>::X = ();