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
Deprecation warnings for atomic types #736
Comments
Agreed, if we can silence just this warning then doing so with a comment makes the most sense. |
vks
added a commit
to vks/rand
that referenced
this issue
Feb 21, 2019
Since Rust 1.34, `ATOMIC_*_INIT` is deprecated in favor of `Atomic*::new`. However, this requires the latter to be `const`, which is not the case for older Rust versions. Alternatively, we could detect the Rust version by introducing build scripts to the crates lacking them. However, this increases build time for a very minor benefit, so the deprecation warnings are ignored instead. Fixes rust-random#736.
vks
added a commit
to vks/rand
that referenced
this issue
Feb 25, 2019
Since Rust 1.34, `ATOMIC_*_INIT` is deprecated in favor of `Atomic*::new`. However, this requires the latter to be `const`, which is not the case for older Rust versions. Alternatively, we could detect the Rust version by introducing build scripts to the crates lacking them. However, this increases build time for a very minor benefit, so the deprecation warnings are ignored instead. Fixes rust-random#736.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Starting with Rust 1.34,
ATOMIC_*_INIT
is deprecated in favor ofAtomic*::new
. However, this requires the function to beconst
, which is not supported on old Rust versions. I see the following options to silence the deprecation warnings:build.rs
andautocfg
to check for Rust 1.34 and useAtomic*::new
accordingly.The disadvantage of 1. is that it will requires adding a
build.rs
torand_os
andrand_jitter
, increasing build time by about one second. For now, it might be better to just go with 2.The text was updated successfully, but these errors were encountered: