-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to stabilized const_fn_trait_bound #325
Conversation
@@ -0,0 +1,16 @@ | |||
fn main() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 fn
on Rust 1.61+ using autocfg.(The first commit is from #327, and needed to fix CI failure)
Closes #299