Skip to content

Commit 9029685

Browse files
authored
Merge pull request #227 from nnethercote/const-recursive_count
Mark `RECURSIVE_COUNT_*` as `const`.
2 parents bccd7b4 + 27241c6 commit 9029685

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

derive/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ fn expand_derive_arbitrary(input: syn::DeriveInput) -> Result<TokenStream> {
6060
const _: () = {
6161
::std::thread_local! {
6262
#[allow(non_upper_case_globals)]
63-
static #recursive_count: ::core::cell::Cell<u32> = ::core::cell::Cell::new(0);
63+
static #recursive_count: ::core::cell::Cell<u32> = const {
64+
::core::cell::Cell::new(0)
65+
};
6466
}
6567

6668
#[automatically_derived]

0 commit comments

Comments
 (0)