Skip to content

Releases: taiki-e/const_fn

0.4.1

25 Aug 15:44
Compare
Choose a tag to compare

0.4.0

25 Aug 06:23
9383c4a
Compare
Choose a tag to compare
  • Add support for version-based code generation. 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).