Rollup merge of #69479 - matthiaskrgr:op_pred, r=Dylan-DPC

clarify operator precedence
This commit is contained in:
Yuki Okushi 2020-02-27 14:38:06 +09:00 committed by GitHub
commit d4700a83ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -304,7 +304,7 @@ impl<S: Sip> super::Hasher for Hasher<S> {
if self.ntail != 0 {
needed = 8 - self.ntail;
self.tail |= unsafe { u8to64_le(msg, 0, cmp::min(length, needed)) } << 8 * self.ntail;
self.tail |= unsafe { u8to64_le(msg, 0, cmp::min(length, needed)) } << (8 * self.ntail);
if length < needed {
self.ntail += length;
return;

View File

@ -997,7 +997,7 @@ impl SpecializedEncoder<IntEncodedWithFixedSize> for opaque::Encoder {
fn specialized_encode(&mut self, x: &IntEncodedWithFixedSize) -> Result<(), Self::Error> {
let start_pos = self.position();
for i in 0..IntEncodedWithFixedSize::ENCODED_SIZE {
((x.0 >> i * 8) as u8).encode(self)?;
((x.0 >> (i * 8)) as u8).encode(self)?;
}
let end_pos = self.position();
assert_eq!((end_pos - start_pos), IntEncodedWithFixedSize::ENCODED_SIZE);

View File

@ -274,7 +274,7 @@ impl Hasher for SipHasher128 {
if self.ntail != 0 {
needed = 8 - self.ntail;
self.tail |= unsafe { u8to64_le(msg, 0, cmp::min(length, needed)) } << 8 * self.ntail;
self.tail |= unsafe { u8to64_le(msg, 0, cmp::min(length, needed)) } << (8 * self.ntail);
if length < needed {
self.ntail += length;
return;