Skip to content
New issue

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

Rollup of 11 pull requests #60986

Merged
merged 25 commits into from
May 21, 2019
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
67ca448
Improve file sidebar in source code view page on mobile
GuillaumeGomez Apr 29, 2019
87d1c17
Cleanup media queries
GuillaumeGomez Apr 29, 2019
bd8885d
Fall back to `/dev/urandom` on `EPERM` for `getrandom`
tbu- May 1, 2019
e2a2500
Fix search sidebar width when no crate select is present
GuillaumeGomez May 2, 2019
ccb9dac
Fix intra-doc link resolution failure on re-exporting libstd
taiki-e May 4, 2019
2adc6da
Fix incremental compilation of cdylib emitting spurious unused_attrib…
oli-obk May 14, 2019
e92d13e
Update ui tests
oli-obk May 14, 2019
eed1e1e
Remove unused field from StableHasher.
michaelwoerister May 17, 2019
cb0039e
Misc changes to rustc_metadata
bjorn3 May 18, 2019
ea7aa76
Document BinaryHeap time complexity
dtolnay May 19, 2019
88fa5c6
Improve type size assertions
petrochenkov May 19, 2019
b9be68c
remove confusing remarks about mixed volatile and non-volatile accesses
RalfJung May 20, 2019
a79c06a
Document requirements for HashStable implementations better.
michaelwoerister May 17, 2019
d8f764b
Set -funwind-tables and -fno-exceptions unconditionally for LLVM's li…
petrhosek May 20, 2019
daf8aca
Rollup merge of #60383 - GuillaumeGomez:fix-position-source-code-file…
Centril May 20, 2019
5a08ca3
Rollup merge of #60453 - tbu-:pr_getrandom_enoperm, r=sfackler
Centril May 20, 2019
bf54251
Rollup merge of #60487 - GuillaumeGomez:fix-search-sidebar-width-colo…
Centril May 20, 2019
a34dae3
Rollup merge of #60511 - taiki-e:libstd-intra-doc, r=Dylan-DPC
Centril May 20, 2019
36b5724
Rollup merge of #60823 - oli-obk:used_unused_no_mangle, r=michaelwoer…
Centril May 20, 2019
3f86fad
Rollup merge of #60915 - michaelwoerister:hashstablestuff, r=estebank
Centril May 20, 2019
65cec43
Rollup merge of #60942 - bjorn3:metadata_loader_refactor, r=michaelwo…
Centril May 20, 2019
864e7a9
Rollup merge of #60952 - dtolnay:heap, r=Amanieu
Centril May 20, 2019
581cf70
Rollup merge of #60959 - petrochenkov:sassert, r=estebank
Centril May 20, 2019
44b5d4d
Rollup merge of #60972 - RalfJung:volatile, r=alexcrichton
Centril May 20, 2019
0c97800
Rollup merge of #60983 - petrhosek:libunwind-no-exceptions, r=alexcri…
Centril May 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unused field from StableHasher.
  • Loading branch information
michaelwoerister committed May 17, 2019
commit eed1e1ecd265071dc45abcd331272e6bb1b919d7
20 changes: 0 additions & 20 deletions src/librustc_data_structures/stable_hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use crate::bit_set;
/// extended to 64 bits if needed.
pub struct StableHasher<W> {
state: SipHasher128,
bytes_hashed: u64,
width: PhantomData<W>,
}

Expand All @@ -33,7 +32,6 @@ impl<W: StableHasherResult> StableHasher<W> {
pub fn new() -> Self {
StableHasher {
state: SipHasher128::new_with_keys(0, 0),
bytes_hashed: 0,
width: PhantomData,
}
}
Expand Down Expand Up @@ -61,11 +59,6 @@ impl<W> StableHasher<W> {
pub fn finalize(self) -> (u64, u64) {
self.state.finish128()
}

#[inline]
pub fn bytes_hashed(&self) -> u64 {
self.bytes_hashed
}
}

impl<W> Hasher for StableHasher<W> {
Expand All @@ -76,37 +69,31 @@ impl<W> Hasher for StableHasher<W> {
#[inline]
fn write(&mut self, bytes: &[u8]) {
self.state.write(bytes);
self.bytes_hashed += bytes.len() as u64;
}

#[inline]
fn write_u8(&mut self, i: u8) {
self.state.write_u8(i);
self.bytes_hashed += 1;
}

#[inline]
fn write_u16(&mut self, i: u16) {
self.state.write_u16(i.to_le());
self.bytes_hashed += 2;
}

#[inline]
fn write_u32(&mut self, i: u32) {
self.state.write_u32(i.to_le());
self.bytes_hashed += 4;
}

#[inline]
fn write_u64(&mut self, i: u64) {
self.state.write_u64(i.to_le());
self.bytes_hashed += 8;
}

#[inline]
fn write_u128(&mut self, i: u128) {
self.state.write_u128(i.to_le());
self.bytes_hashed += 16;
}

#[inline]
Expand All @@ -115,37 +102,31 @@ impl<W> Hasher for StableHasher<W> {
// platforms. This is important for symbol hashes when cross compiling,
// for example.
self.state.write_u64((i as u64).to_le());
self.bytes_hashed += 8;
}

#[inline]
fn write_i8(&mut self, i: i8) {
self.state.write_i8(i);
self.bytes_hashed += 1;
}

#[inline]
fn write_i16(&mut self, i: i16) {
self.state.write_i16(i.to_le());
self.bytes_hashed += 2;
}

#[inline]
fn write_i32(&mut self, i: i32) {
self.state.write_i32(i.to_le());
self.bytes_hashed += 4;
}

#[inline]
fn write_i64(&mut self, i: i64) {
self.state.write_i64(i.to_le());
self.bytes_hashed += 8;
}

#[inline]
fn write_i128(&mut self, i: i128) {
self.state.write_i128(i.to_le());
self.bytes_hashed += 16;
}

#[inline]
Expand All @@ -154,7 +135,6 @@ impl<W> Hasher for StableHasher<W> {
// platforms. This is important for symbol hashes when cross compiling,
// for example.
self.state.write_i64((i as i64).to_le());
self.bytes_hashed += 8;
}
}

Expand Down