Skip to content

Commit

Permalink
Force random const eval (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
CasualX authored Mar 3, 2023
1 parent df094e2 commit 04b49df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ pub mod xref;
#[macro_export]
macro_rules! random {
($ty:ident $(, $seeds:expr)* $(,)?) => {{
const _RANDOM_ENTROPY: u64 = $crate::entropy(concat!(file!(), ":", line!(), ":", column!() $(, ":", $seeds)*));
$crate::__random_cast!($ty, _RANDOM_ENTROPY)
const _ENTROPY: u64 = $crate::entropy(concat!(file!(), ":", line!(), ":", column!() $(, ":", $seeds)*));
const _RANDOM: $ty = $crate::__random_cast!($ty, _ENTROPY);
_RANDOM
}};
}

Expand Down

0 comments on commit 04b49df

Please sign in to comment.