diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-09-09 00:22:22 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-11-22 04:38:00 +0200 |
| commit | 3ce8d444affefb61ee733aa21da7f1ebc1b515e9 (patch) | |
| tree | 4982c64d3bfd5a9f40a583414467a2a5689c4d9c /src/librustc/mir/interpret | |
| parent | d56e8920852adec249c9d8159348a94dcafbd31c (diff) | |
| download | rust-3ce8d444affefb61ee733aa21da7f1ebc1b515e9.tar.gz rust-3ce8d444affefb61ee733aa21da7f1ebc1b515e9.zip | |
rustc_target: separate out an individual Align from AbiAndPrefAlign.
Diffstat (limited to 'src/librustc/mir/interpret')
| -rw-r--r-- | src/librustc/mir/interpret/allocation.rs | 4 | ||||
| -rw-r--r-- | src/librustc/mir/interpret/error.rs | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/librustc/mir/interpret/allocation.rs b/src/librustc/mir/interpret/allocation.rs index eb44c3c8c5f..4e83cc16ab3 100644 --- a/src/librustc/mir/interpret/allocation.rs +++ b/src/librustc/mir/interpret/allocation.rs @@ -12,7 +12,7 @@ use super::{Pointer, EvalResult, AllocId}; -use ty::layout::{Size, AbiAndPrefAlign}; +use ty::layout::{Size, Align, AbiAndPrefAlign}; use syntax::ast::Mutability; use std::iter; use mir; @@ -104,7 +104,7 @@ impl<Tag, Extra: Default> Allocation<Tag, Extra> { } pub fn from_byte_aligned_bytes(slice: &[u8]) -> Self { - Allocation::from_bytes(slice, AbiAndPrefAlign::from_bytes(1, 1).unwrap()) + Allocation::from_bytes(slice, AbiAndPrefAlign::new(Align::from_bytes(1).unwrap())) } pub fn undef(size: Size, align: AbiAndPrefAlign) -> Self { diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs index bae53a9216a..1a33d362396 100644 --- a/src/librustc/mir/interpret/error.rs +++ b/src/librustc/mir/interpret/error.rs @@ -527,7 +527,7 @@ impl<'tcx, O: fmt::Debug> fmt::Debug for EvalErrorKind<'tcx, O> { write!(f, "tried to interpret an invalid 32-bit value as a char: {}", c), AlignmentCheckFailed { required, has } => write!(f, "tried to access memory with alignment {}, but alignment {} is required", - has.abi(), required.abi()), + has.abi.bytes(), required.abi.bytes()), TypeNotPrimitive(ty) => write!(f, "expected primitive type, got {}", ty), Layout(ref err) => @@ -537,8 +537,9 @@ impl<'tcx, O: fmt::Debug> fmt::Debug for EvalErrorKind<'tcx, O> { MachineError(ref inner) => write!(f, "{}", inner), IncorrectAllocationInformation(size, size2, align, align2) => - write!(f, "incorrect alloc info: expected size {} and align {}, got size {} and \ - align {}", size.bytes(), align.abi(), size2.bytes(), align2.abi()), + write!(f, "incorrect alloc info: expected size {} and align {}, \ + got size {} and align {}", + size.bytes(), align.abi.bytes(), size2.bytes(), align2.abi.bytes()), Panic { ref msg, line, col, ref file } => write!(f, "the evaluated program panicked at '{}', {}:{}:{}", msg, file, line, col), InvalidDiscriminant(val) => |
