Skip to content

Commit

Permalink
Fix rebase fallout and compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Dec 20, 2016
1 parent 4ebddcc commit 526c505
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/librustc_data_structures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ crate-type = ["dylib"]
[dependencies]
log = { path = "../liblog" }
serialize = { path = "../libserialize" }
rustc_i128 = { path = "../librustc_i128" }
2 changes: 2 additions & 0 deletions src/librustc_data_structures/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ extern crate serialize as rustc_serialize; // used by deriving
#[cfg(unix)]
extern crate libc;

extern crate rustc_i128;

pub use rustc_serialize::hex::ToHex;

pub mod array_vec;
Expand Down
5 changes: 3 additions & 2 deletions src/librustc_data_structures/stable_hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ use std::marker::PhantomData;
use std::mem;
use blake2b::Blake2bHasher;
use rustc_serialize::leb128;
use rustc_i128::{u128,i128};

fn write_unsigned_leb128_to_buf(buf: &mut [u8; 16], value: u64) -> usize {
leb128::write_unsigned_leb128_to(value, |i, v| buf[i] = v)
leb128::write_unsigned_leb128_to(value as u128, |i, v| buf[i] = v)
}

fn write_signed_leb128_to_buf(buf: &mut [u8; 16], value: i64) -> usize {
leb128::write_signed_leb128_to(value, |i, v| buf[i] = v)
leb128::write_signed_leb128_to(value as i128, |i, v| buf[i] = v)
}

/// When hashing something that ends up affecting properties like symbol names. We
Expand Down
4 changes: 2 additions & 2 deletions src/libserialize/leb128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn write_to_vec(vec: &mut Vec<u8>, position: usize, byte: u8) {
/// The callback `write` is called once for each position
/// that is to be written to with the byte to be encoded
/// at that position.
pub fn write_unsigned_leb128_to<W>(mut value: u64, mut write: W) -> usize
pub fn write_unsigned_leb128_to<W>(mut value: u128, mut write: W) -> usize
where W: FnMut(usize, u8)
{
let mut position = 0;
Expand All @@ -48,7 +48,7 @@ pub fn write_unsigned_leb128_to<W>(mut value: u64, mut write: W) -> usize
position
}

pub fn write_unsigned_leb128(out: &mut Vec<u8>, start_position: usize, value: u64) -> usize {
pub fn write_unsigned_leb128(out: &mut Vec<u8>, start_position: usize, value: u128) -> usize {
write_unsigned_leb128_to(value, |i, v| write_to_vec(out, start_position+i, v))
}

Expand Down

0 comments on commit 526c505

Please sign in to comment.