Skip to content

Commit

Permalink
Support #[repr(u128)]
Browse files Browse the repository at this point in the history
  • Loading branch information
meithecatte committed Sep 27, 2020
1 parent 05919bb commit b6d2d98
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions enumflags_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct Flag {
}

enum FlagValue {
Literal(u64),
Literal(u128),
Deferred,
Inferred,
}
Expand Down Expand Up @@ -48,7 +48,7 @@ pub fn bitflags_internal(
}

/// Try to evaluate the expression given.
fn fold_expr(expr: &syn::Expr) -> Option<u64> {
fn fold_expr(expr: &syn::Expr) -> Option<u128> {
use syn::Expr;
match expr {
Expr::Lit(ref expr_lit) => {
Expand Down Expand Up @@ -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
= ();
Expand Down

0 comments on commit b6d2d98

Please sign in to comment.