-
Notifications
You must be signed in to change notification settings - Fork 10
Conversation
I added a static assertion as suggested in #49 but I am not sure I did it correctly. First of all the docs says that the following is to be added to lib.rs
This lead to a I then verified that
This may very well be correct, but I wasn't sure so it would be great if you could have an extra look at this. Also: Travis failed. Not sure why.
Not sure what this is about. The same command worked in the master build. |
I think the build failure is caused by rust-lang/cargo#7507. I will try to fix this in a separate PR in the coming days. |
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. Other than my comment about moving the static assert next to the code that relies on the assertion, I'd be happy to merge this.
libsignal-protocol/src/context.rs
Outdated
// | ||
// See https://github.com/Michael-F-Bryan/libsignal-protocol-rs/issues/49 | ||
// for details. | ||
static_assertions::assert_not_impl_all!(Context: Send, Sync); |
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.
Could this line be moved directly above lock_function()
? That way our assertion that Context: !Send + !Sync
is right next to the comment that says locking isn't required as long as Context
doesn't implement Send
and Sync
.
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.
Agree. This looks better.
Fixed in eddb1cd
The build failure is fixed by #52. I would like to have that merged before this change to not fail the build on master. |
This change removes the mutex capabilities of lock_function and unlock_function as it turns out that locking is not required as `Context` cannot be shared between threads as long as it does not implement the `std::marker::Sync` trait.
eddb1cd
to
66d8f07
Compare
@Michael-F-Bryan rebase done... |
Build still fails for |
Looking at the Would you be able to update this line with the new version and also add a comment saying it's needed for |
The static_assertions crate requires rustc 1.37.0
This PR implements the noop locking part of #49.