diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/mir/interpret/allocation.rs | 6 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/memory.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc/mir/interpret/allocation.rs b/src/librustc/mir/interpret/allocation.rs index b1e92ef4b51..d6c740794d5 100644 --- a/src/librustc/mir/interpret/allocation.rs +++ b/src/librustc/mir/interpret/allocation.rs @@ -59,7 +59,7 @@ pub trait AllocationExtra<Tag, MemoryExtra>: ::std::fmt::Debug + Clone { fn memory_allocated( _size: Size, _memory_extra: &MemoryExtra - ) -> EvalResult<'tcx, Self>; + ) -> Self; /// Hook for performing extra checks on a memory read access. /// @@ -102,8 +102,8 @@ impl AllocationExtra<(), ()> for () { fn memory_allocated( _size: Size, _memory_extra: &() - ) -> EvalResult<'tcx, Self> { - Ok(()) + ) -> Self { + () } } diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index b52feb41370..5c293bac74a 100644 --- a/src/librustc_mir/interpret/memory.rs +++ b/src/librustc_mir/interpret/memory.rs @@ -143,7 +143,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> { align: Align, kind: MemoryKind<M::MemoryKinds>, ) -> EvalResult<'tcx, Pointer> { - let extra = AllocationExtra::memory_allocated(size, &self.extra)?; + let extra = AllocationExtra::memory_allocated(size, &self.extra); Ok(Pointer::from(self.allocate_with(Allocation::undef(size, align, extra), kind)?)) } |
