We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In a few places I've seen a *mut () used to make a struct without Send and Sync traits, for instance this:
*mut ()
Send
Sync
// We store a raw pointer because it's the only way at the moment to remove `Send`/`Sync` from the // object. struct ComInitialized(*mut ());
Currently I'm using PhantomData<Rc<()>> for the same:
PhantomData<Rc<()>>
comedy-rs/src/com.rs
Lines 142 to 148 in c244b91
I think PhantomData is still the right way to go, but it may be clearer to do PhantomData<*mut ()>. I don't know if there is any practical difference.
PhantomData
PhantomData<*mut ()>
Also using a tuple struct instead of one unused named field would be less noisy.
While I'm at it, there should be a compile_fail doctest to ensure Send and Sync are missing (I don't know of any other way to assert a negative impl).
compile_fail
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In a few places I've seen a
*mut ()
used to make a struct withoutSend
andSync
traits, for instance this:Currently I'm using
PhantomData<Rc<()>>
for the same:comedy-rs/src/com.rs
Lines 142 to 148 in c244b91
I think
PhantomData
is still the right way to go, but it may be clearer to doPhantomData<*mut ()>
. I don't know if there is any practical difference.Also using a tuple struct instead of one unused named field would be less noisy.
While I'm at it, there should be a
compile_fail
doctest to ensureSend
andSync
are missing (I don't know of any other way to assert a negative impl).The text was updated successfully, but these errors were encountered: