Browse Source

remove const_eval_limit increase except for cfg(test), which needs it

Roms1383-feat/seed
Jonathan Strong 2 years ago
parent
commit
e765ab544a
  1. 2
      Cargo.toml
  2. 7
      README.md
  3. 5
      src/lib.rs

2
Cargo.toml

@ -1,6 +1,6 @@
[package] [package]
name = "const-crc32" name = "const-crc32"
version = "1.1.0" version = "1.2.0"
edition = "2021" edition = "2021"
authors = ["Jonathan Strong <jstrong@shipyard.rs>"] authors = ["Jonathan Strong <jstrong@shipyard.rs>"]
license = "MIT" license = "MIT"

7
README.md

@ -18,7 +18,10 @@ if used on dynamic data at runtime. Usage should generally be restricted to decl
## `#[const_eval_limit]` ## `#[const_eval_limit]`
This crate sets `#[const_eval_limit]` to 1,000,000,000 to avoid hitting the limit when You may need to increase the crate-wide `const_eval_limit` setting to use `const_crc32` for larger byte slices.
executing the `const fn`, which requires `#![feature(const_eval_limit)]`.
Increating `const_eval_limit` requires the nightly-only `#![feature(const_eval_limit)]`.
Previously, this crate set the limit itself, however, as of the 2022-10-30 nightly, the value set in `const_crc32` does not increase the limit for crates which use the library.
Compile time for `const` data around 100k is less than 1s. Compile time for `const` data around 100k is less than 1s.

5
src/lib.rs

@ -8,9 +8,8 @@
//! assert_eq!(CKSUM, 0x414fa339_u32); //! assert_eq!(CKSUM, 0x414fa339_u32);
//! ``` //! ```
#![feature(const_eval_limit)] #![cfg_attr(test, feature(const_eval_limit))]
#![cfg_attr(test, const_eval_limit = "0")]
#![const_eval_limit = "1000000000"]
/// used to generate up a [u32; 256] lookup table in `crc32`. this computes /// used to generate up a [u32; 256] lookup table in `crc32`. this computes
/// the table on demand for a given "index" `i` /// the table on demand for a given "index" `i`

Loading…
Cancel
Save