-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
src/lib.rs
Outdated
@@ -58,6 +58,8 @@ | |||
#![cfg_attr(feature = "nightly", feature(alloc))] | |||
#![cfg_attr(not(test), no_std)] | |||
|
|||
#![deny(missing_docs, warnings, missing_debug_implementations)] |
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 don't feel comfortable with deny
ing lints because future compiler updates could suddenly make our code stop compiling. See rust-lang/rust#47204 (comment) for a recent example of a new warning breaking existing crates. This can be especially frustrating for crates depending on crossbeam.
We should be fine with just #![warn(missing_docs, missing_debug_implementations)]
.
And if that is not enough, we can add RUSTFLAGS="-D warnings"
to the Travis config. Better to break our CI builds than the whole ecosystem. :)
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.
This can be especially frustrating for crates depending on crossbeam.
AFAIA cargo caps lints when building dependencies, so it would only affect crossbeam itself.
@stjepang I couldn't think of that :) I changed it to |
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.
Since we're publicly exposing Pointer
, this might be a good time to reconsider the naming choices around Pointer::from_data
and Pointer::into_data
.
The word data
is somewhat vague and could be mistaken for the actual data behind the pointer (of type T
). Perhaps from_usize
and into_usize
would sound better? Any other ideas?
@stjepang I'm happy with |
@Vtec234, any thoughts on this rename? |
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, and I agree with the rename.
Based on two approvals, I'm merging it. Thanks! |
This PR makes the following changes:
Mark
Pointer
as public. This is necessary for the crates that implement data structures which exposeAtomic
-like API (e.g.store
() andcompare_and_swap()
).I'm thinking of concurrent ART as a use case. It's basically the infinite array of
Atomic<T>
, where initially everything is justAtomic::null()
. Basically, I'd like to exposeArt::store<P: Pointer<T>>(index: usize, value: P)
.Add
#![deny(missing_docs, warnings, missing_debug_implementations)]
, which is generally a good thing.