-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add empty portable-atomic-util crate #38
Conversation
if version.minor < 36 { | ||
println!("cargo:rustc-cfg=portable_atomic_no_alloc"); | ||
} | ||
// raw_ref_macros stabilized in Rust 1.51 (nightly-2021-01-31) https://github.com/rust-lang/rust/pull/80886 | ||
if !version.probe(51, 2021, 1, 30) { | ||
println!("cargo:rustc-cfg=portable_atomic_no_raw_ref_macros"); | ||
} | ||
// unsafe_op_in_unsafe_fn stabilized in Rust 1.52 (nightly-2021-03-11): https://github.com/rust-lang/rust/pull/79208 | ||
if !version.probe(52, 2021, 3, 10) { | ||
println!("cargo:rustc-cfg=portable_atomic_no_unsafe_op_in_unsafe_fn"); | ||
} | ||
|
||
if version.nightly { | ||
// `cfg(sanitize = "..")` is not stabilized. | ||
let sanitize = env::var("CARGO_CFG_SANITIZE").unwrap_or_default(); | ||
if sanitize.contains("thread") { | ||
println!("cargo:rustc-cfg=portable_atomic_sanitize_thread"); | ||
} | ||
} |
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.
IIRC, raw_ref_macros (addr_of!
and addr_of_mut!
), alloc, and cfg(sanitize = "thread")
are needed to implement Arc
. Some impls in #8 also need alloc
.
bors r+ |
FYI @notgull |
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.
Looks good to me!
This adds an empty crate named
portable-atomic-util
.For now, I'm considering putting the features proposed in #1 (#8) and #37 into this crate, but they may be merged into the main
portable-atomic
crate in the future.