Update to stabilized const_fn_trait_bound#325
Conversation
| @@ -0,0 +1,16 @@ | |||
| fn main() { | |||
There was a problem hiding this comment.
Adding a build script will make building a bit slower as the build script has to be compiled and the main crate has to wait on running the build script.
There was a problem hiding this comment.
Yeah. An alternative approach without such drawbacks is to use the options feature. If the maintainer prefers that approach, I'm happy to switch to using it.
There was a problem hiding this comment.
I personally don't mind this: the build script has no dependencies and can be compiled in parallel with other crates, so it is usually not noticable.
c5944c1 to
2c8dc2b
Compare
lock_api/build.rs
Outdated
| Ok(cfg) => cfg, | ||
| Err(e) => { | ||
| println!( | ||
| "cargo:warning=lock_api: unable to determine rustc version: {}", |
There was a problem hiding this comment.
I'd just use an unwrap here. There's no reason we shouldn't be able to detect the rustc version, and if we can't then it would be better to loudly fail so it can be fixed.
There was a problem hiding this comment.
Updated to panic on rustc version detection failure.
2c8dc2b to
cbab7b0
Compare
const_fn_trait_bound has been stabilized on Rust 1.61 (currently nightly, nightly-2022-03-08+): rust-lang/rust#93827
This PR removes
#![feature(const_fn_trait_bound)]and makes constructors for lock typesconst fnon Rust 1.61+ using autocfg.(The first commit is from #327, and needed to fix CI failure)
Closes #299