NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #1114 most downloaded on crates.io
A lightweight attribute for easy generation of const functions with conditional compilations.
Last release 7 months ago
03 Mar 2026
Release timing varies
gaps range from 3 weeks to 2.3 years
Nearly every release is documented
notes for 24 of 24 stable releases
1 version withdrawn
withdrawn after publishing
8 years old
25 releases · first in 2018
Enable release immutability .
Improve Windows host support by workaround rustc bug fixed in Rust 1.84 .
Improve Windows host support by workaround rustc bug fixed in Rust 1.84.
Respect RUSTC_BOOTSTRAP=-1 recently added in nightly in rustc version detection.
One column per quarter.
Respect RUSTC_WRAPPER in rustc version detection.
RUSTC_WRAPPER in rustc version detection.Fix detection of -Z assume-incomplete-release in recent nightly compilers.
Fix parsing of macro metavariable in attribute arguments.
Support compiling with RUSTFLAGS='-Z assume-incomplete-release' on nightly compiler.
Fix compatibility issues with const generics.
Exclude unneeded files from crates.io.
Accept const_fn attribute with no arguments and functions without const keyword. This allows const_fn to be used as an optional dependency.
Accept const_fn attribute with no arguments and functions without const keyword.
This allows const_fn to be used as an optional dependency.
#[cfg_attr(feature = "...", const_fn::const_fn)]
pub fn func() {
/* ... */
}const_fn no longer fails to compile if unable to determine rustc version. Instead, it now displays a warning.
Improve error messages when failed to parse version information.
Fix compile failure with non-cargo build systems.
Add support for version-based code generation. (#17) The following conditions are available:
Add support for version-based code generation. (#17) The following conditions are available:
use const_fn::const_fn;
// function is `const` on specified version and later compiler (including beta and nightly)
#[const_fn("1.36")]
pub const fn version() {
/* ... */
}
// function is `const` on nightly compiler (including dev build)
#[const_fn(nightly)]
pub const fn nightly() {
/* ... */
}
// function is `const` if `cfg(...)` is true
#[const_fn(cfg(...))]
pub const fn cfg() {
/* ... */
}
// function is `const` if `cfg(feature = "...")` is true
#[const_fn(feature = "...")]
pub const fn feature() {
/* ... */
}
Improve compile time by removing proc-macro related dependencies (#18, #20).
- Updated syn-mid to 0.5.
syn-mid to 0.5.- #[const_fn] attribute may only be used on const functions.
#[const_fn] attribute may only be used on const functions.Updated proc-macro2, syn, and quote to 1.0.
Updated proc-macro2, syn, and quote to 1.0.
Updated syn-mid to 0.4.
Transition to Rust 2018. With this change, the minimum required version will go up to Rust 1.31.
- Update syn-mid version to 0.3
- Reduce compilation time
- Revert 0.1.4
Note: This release has been yanked.
Note: This release has been yanked.
- Fix dependencies
- Improve error messages
- Improve an error message
[Unreleased]: https://github.com/taiki-e/const_fn/compare/v0.4.12...HEAD [0.4.12]: https://github.com/taiki-e/const_fn/compare/v0.4.11...v0.4.12 [0.4.
Initial release
Your coding agent can read these notes before it upgrades. Set up the MCP server →