Fix rebase fallout and compilation fixes
This commit is contained in:
parent
dd10c5a503
commit
0a481fe5d2
1
src/Cargo.lock
generated
1
src/Cargo.lock
generated
@ -330,6 +330,7 @@ name = "rustc_data_structures"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"log 0.0.0",
|
||||
"rustc_i128 0.0.0",
|
||||
"serialize 0.0.0",
|
||||
]
|
||||
|
||||
|
@ -11,3 +11,4 @@ crate-type = ["dylib"]
|
||||
[dependencies]
|
||||
log = { path = "../liblog" }
|
||||
serialize = { path = "../libserialize" }
|
||||
rustc_i128 = { path = "../librustc_i128" }
|
||||
|
@ -44,6 +44,8 @@
|
||||
#[cfg(unix)]
|
||||
extern crate libc;
|
||||
|
||||
extern crate rustc_i128;
|
||||
|
||||
pub use rustc_serialize::hex::ToHex;
|
||||
|
||||
pub mod array_vec;
|
||||
|
@ -13,13 +13,14 @@
|
||||
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
|
||||
|
@ -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;
|
||||
@ -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))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user