signalapp / libsignal

Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.
GNU Affero General Public License v3.0
3.06k stars 362 forks source link

lean on stable Ordering repr(i8) #503

Closed cosmicexplorer closed 1 year ago

cosmicexplorer commented 1 year ago
jrose-signal commented 1 year ago

This is correct, and shorter, but I'm not sure it's better. It is the case that Rust orderings have the raw representations we want here (the ones established by memcmp oh so long ago), but you had to write down a comment to say that, because it's not exposed in the docs (even though it is in the source, and stable). The compiler should absolutely optimize the first into the second anyway, but it doesn't quite today??. I'll file a Rust bug about that.

EDIT: https://github.com/rust-lang/rust/issues/106459

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been closed due to inactivity.