Skip to content

Commit

Permalink
Fix test failure, oom has been renamed to handle_alloc_error.
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm committed Jul 7, 2018
1 parent 7a93c08 commit 895897e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vec-final.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::ptr::{Unique, NonNull, self};
use std::mem;
use std::ops::{Deref, DerefMut};
use std::marker::PhantomData;
use std::alloc::{Alloc, GlobalAlloc, Layout, Global, oom};
use std::alloc::{Alloc, GlobalAlloc, Layout, Global, handle_alloc_error};

struct RawVec<T> {
ptr: Unique<T>,
Expand Down Expand Up @@ -45,9 +45,9 @@ impl<T> RawVec<T> {
(new_cap, ptr)
};

// If allocate or reallocate fail, oom
// If allocate or reallocate fail, handle it
if ptr.is_err() {
oom(Layout::from_size_align_unchecked(
handle_alloc_error(Layout::from_size_align_unchecked(
new_cap * elem_size,
mem::align_of::<T>(),
))
Expand Down

0 comments on commit 895897e

Please sign in to comment.