Skip to content

Rollup of 14 pull requests #48177

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

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c04d86d
Work around LLVM OCAML binding installation failure
roblabla Jan 29, 2018
4d92fe2
Fix span bug.
jseyfried Feb 9, 2018
4f8049a
Add Range[Inclusive]::is_empty
scottmcm Feb 9, 2018
7fe182f
Fix tidy
scottmcm Feb 9, 2018
b5cb393
Use is_empty in range iteration exhaustion tests
scottmcm Feb 10, 2018
6f70a11
range_is_empty tracking issue is #48111
scottmcm Feb 10, 2018
0cccd9a
Show better warning for trying to cast non-u8 scalar to char
GuillaumeGomez Feb 6, 2018
14f488e
Whitelist pclmul x86 feature flag
newpavlov Feb 10, 2018
877272b
typo fix
newpavlov Feb 10, 2018
3c01dea
Add comment about the problem, and use provided path if available
roblabla Feb 10, 2018
45d5a42
Correct a few stability attributes
ollie27 Feb 10, 2018
8be3068
added conversion from Rust feature to LLVM feature
newpavlov Feb 10, 2018
c97aa09
iterator instead loop
newpavlov Feb 10, 2018
161e8ff
typo: correct endianess to endianness (this also changes function nam…
matthiaskrgr Feb 10, 2018
7c6adb4
fixed errors
newpavlov Feb 11, 2018
22b0489
Add the emptiness condition to the docs; add a PartialOrd example wit…
scottmcm Feb 11, 2018
bf69b0f
Upgrade the Travis CI macOS images for testing from Xcode 8.3 to 9.2.
kennytm Jan 25, 2018
a003cb7
Add test.
jseyfried Feb 9, 2018
c2a31de
Dangling pointer fix
newpavlov Feb 11, 2018
bd426f1
Update ops range example to avoid confusion between indexes and values.
Feb 12, 2018
f7cabc6
Continue parsing function after finding `...` arg
estebank Feb 12, 2018
0f16eee
rustc: Add the ability to not run dsymutil
alexcrichton Jan 26, 2018
43e8ac2
rustc: Persist LLVM's `Linker` in Fat LTO
alexcrichton Feb 12, 2018
4c658f7
Update compiletest's `read2` function
alexcrichton Feb 12, 2018
f237e9e
Remove allocation from width of character function.
Mark-Simulacrum Feb 12, 2018
60f13d9
Rollup merge of #47784 - alexcrichton:less-dsymutil, r=michaelwoerister
kennytm Feb 13, 2018
58da4d5
Rollup merge of #47846 - roblabla:bugfix-ocaml, r=kennytm
kennytm Feb 13, 2018
9cf75c2
Rollup merge of #48033 - GuillaumeGomez:better-char-cast-message, r=e…
kennytm Feb 13, 2018
ab7257d
Rollup merge of #48083 - jseyfried:improve_tuple_struct_field_access_…
kennytm Feb 13, 2018
e44f2ae
Rollup merge of #48087 - scottmcm:range_is_empty, r=kennytm,alexcrichton
kennytm Feb 13, 2018
3cfcdc9
Rollup merge of #48114 - kennytm:xcode9, r=alexcrichton
kennytm Feb 13, 2018
dd2f1f8
Rollup merge of #48126 - newpavlov:patch-1, r=alexcrichton
kennytm Feb 13, 2018
e58347b
Rollup merge of #48130 - ollie27:stab, r=Mark-Simulacrum
kennytm Feb 13, 2018
2deeb06
Rollup merge of #48133 - matthiaskrgr:endianess_to_endianness, r=oli-obk
kennytm Feb 13, 2018
c67b789
Rollup merge of #48151 - echochamber:update_range_example, r=estebank
kennytm Feb 13, 2018
7c3c054
Rollup merge of #48154 - estebank:issue-31481, r=nikomatsakis
kennytm Feb 13, 2018
a6f8eb1
Rollup merge of #48163 - alexcrichton:persistent-linker, r=rkruppe
kennytm Feb 13, 2018
1806b19
Rollup merge of #48165 - alexcrichton:update-read2, r=Mark-Simulacrum
kennytm Feb 13, 2018
5b25477
Rollup merge of #48167 - Mark-Simulacrum:remove-allocation-codemap, r…
kennytm Feb 13, 2018
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
typo: correct endianess to endianness (this also changes function nam…
…es!)
  • Loading branch information
matthiaskrgr committed Feb 10, 2018
commit 161e8ffda79d25ef7a570bf0c0d884201267c6cb
32 changes: 16 additions & 16 deletions src/librustc_mir/interpret/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
self.tcx.data_layout.pointer_size.bytes()
}

pub fn endianess(&self) -> layout::Endian {
pub fn endianness(&self) -> layout::Endian {
self.tcx.data_layout.endian
}

Expand Down Expand Up @@ -722,7 +722,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {

pub fn read_primval(&self, ptr: MemoryPointer, ptr_align: Align, size: u64, signed: bool) -> EvalResult<'tcx, PrimVal> {
self.check_relocation_edges(ptr, size)?; // Make sure we don't read part of a pointer as a pointer
let endianess = self.endianess();
let endianness = self.endianness();
let bytes = self.get_bytes_unchecked(ptr, size, ptr_align.min(self.int_align(size)))?;
// Undef check happens *after* we established that the alignment is correct.
// We must not return Ok() for unaligned pointers!
Expand All @@ -731,9 +731,9 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
}
// Now we do the actual reading
let bytes = if signed {
read_target_int(endianess, bytes).unwrap() as u128
read_target_int(endianness, bytes).unwrap() as u128
} else {
read_target_uint(endianess, bytes).unwrap()
read_target_uint(endianness, bytes).unwrap()
};
// See if we got a pointer
if size != self.pointer_size() {
Expand All @@ -756,7 +756,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
}

pub fn write_primval(&mut self, ptr: MemoryPointer, ptr_align: Align, val: PrimVal, size: u64, signed: bool) -> EvalResult<'tcx> {
let endianess = self.endianess();
let endianness = self.endianness();

let bytes = match val {
PrimVal::Ptr(val) => {
Expand Down Expand Up @@ -788,9 +788,9 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
let align = self.int_align(size);
let dst = self.get_bytes_mut(ptr, size, ptr_align.min(align))?;
if signed {
write_target_int(endianess, dst, bytes as i128).unwrap();
write_target_int(endianness, dst, bytes as i128).unwrap();
} else {
write_target_uint(endianess, dst, bytes).unwrap();
write_target_uint(endianness, dst, bytes).unwrap();
}
}

Expand Down Expand Up @@ -941,41 +941,41 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
}

////////////////////////////////////////////////////////////////////////////////
// Methods to access integers in the target endianess
// Methods to access integers in the target endianness
////////////////////////////////////////////////////////////////////////////////

fn write_target_uint(
endianess: layout::Endian,
endianness: layout::Endian,
mut target: &mut [u8],
data: u128,
) -> Result<(), io::Error> {
let len = target.len();
match endianess {
match endianness {
layout::Endian::Little => target.write_uint128::<LittleEndian>(data, len),
layout::Endian::Big => target.write_uint128::<BigEndian>(data, len),
}
}
fn write_target_int(
endianess: layout::Endian,
endianness: layout::Endian,
mut target: &mut [u8],
data: i128,
) -> Result<(), io::Error> {
let len = target.len();
match endianess {
match endianness {
layout::Endian::Little => target.write_int128::<LittleEndian>(data, len),
layout::Endian::Big => target.write_int128::<BigEndian>(data, len),
}
}

fn read_target_uint(endianess: layout::Endian, mut source: &[u8]) -> Result<u128, io::Error> {
match endianess {
fn read_target_uint(endianness: layout::Endian, mut source: &[u8]) -> Result<u128, io::Error> {
match endianness {
layout::Endian::Little => source.read_uint128::<LittleEndian>(source.len()),
layout::Endian::Big => source.read_uint128::<BigEndian>(source.len()),
}
}

fn read_target_int(endianess: layout::Endian, mut source: &[u8]) -> Result<i128, io::Error> {
match endianess {
fn read_target_int(endianness: layout::Endian, mut source: &[u8]) -> Result<i128, io::Error> {
match endianness {
layout::Endian::Little => source.read_int128::<LittleEndian>(source.len()),
layout::Endian::Big => source.read_int128::<BigEndian>(source.len()),
}
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ impl f32 {
/// This is currently identical to `transmute::<u32, f32>(v)` on all platforms.
/// It turns out this is incredibly portable, for two reasons:
///
/// * Floats and Ints have the same endianess on all supported platforms.
/// * Floats and Ints have the same endianness on all supported platforms.
/// * IEEE-754 very precisely specifies the bit layout of floats.
///
/// However there is one caveat: prior to the 2008 version of IEEE-754, how
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ impl f64 {
/// This is currently identical to `transmute::<u64, f64>(v)` on all platforms.
/// It turns out this is incredibly portable, for two reasons:
///
/// * Floats and Ints have the same endianess on all supported platforms.
/// * Floats and Ints have the same endianness on all supported platforms.
/// * IEEE-754 very precisely specifies the bit layout of floats.
///
/// However there is one caveat: prior to the 2008 version of IEEE-754, how
Expand Down