Skip to content

Commit 895897e

Browse files
committed
Fix test failure, oom has been renamed to handle_alloc_error.
See rust-lang/rust#51543.
1 parent 7a93c08 commit 895897e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vec-final.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::ptr::{Unique, NonNull, self};
99
use std::mem;
1010
use std::ops::{Deref, DerefMut};
1111
use std::marker::PhantomData;
12-
use std::alloc::{Alloc, GlobalAlloc, Layout, Global, oom};
12+
use std::alloc::{Alloc, GlobalAlloc, Layout, Global, handle_alloc_error};
1313

1414
struct RawVec<T> {
1515
ptr: Unique<T>,
@@ -45,9 +45,9 @@ impl<T> RawVec<T> {
4545
(new_cap, ptr)
4646
};
4747

48-
// If allocate or reallocate fail, oom
48+
// If allocate or reallocate fail, handle it
4949
if ptr.is_err() {
50-
oom(Layout::from_size_align_unchecked(
50+
handle_alloc_error(Layout::from_size_align_unchecked(
5151
new_cap * elem_size,
5252
mem::align_of::<T>(),
5353
))

0 commit comments

Comments
 (0)