-
Notifications
You must be signed in to change notification settings - Fork 121
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
Is the separate nightly version still needed after 1.27.0? #102
Comments
If this is going to be done, please do it with care so that we don't cause the entire ecosystem to bump their minimum Rust version. lazy-static is as core of a crate as it gets. We should be conservative. |
One option could be to use a build script to determine whether we're compiling against 1.27+ to decide whether we use the |
@KodrAus Yup! That's what I did with the regex crate to solve the same problem (but for SIMD). |
@anp If you're interested, would you like to submit a PR that determines whether we're compiling on 1.27+ using a |
Sounds great to me. I'll try to do this tonight, but if someone comes along in weeks/months/years and I've abdicated please feel free to pick up! |
You don't need language support for unsafe fn unreachable_unchecked() -> ! {
enum Void {}
match ::std::mem::uninitialized::<Void>() {}
} And you wouldn't even a version check, this polyfill works great (check LLVM IR/ASM), and I expect you won't need to use the one in core/std. You can just wait to remove the polyfill until you (if ever) bump the minimum needed version past 1.27. EDIT: You can see that it works even on Rust 1.0: https://godbolt.org/g/sxroUe |
A very slightly modified copy of
nightly_lazy.rs
compiles against 1.27 now thathint::unreachable_unchecked
was stabilized. I don't actually know if the nightly version is in some way preferred or what nursery crates' compiler backcompat story is. I'm sure there are other things to consider there too.Would a PR to make it the default be of interest?
The text was updated successfully, but these errors were encountered: