diff options
| author | FenrirWolf <[email protected]> | 2018-08-19 18:01:18 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-08-19 18:01:18 -0600 |
| commit | 15cb3c1e91842a68a8e50e1e1a42aefab13cc25e (patch) | |
| tree | a514fde042ff2a504a03305bfe0894ff8cd8d47e /ctr-std/src/collections/hash/table.rs | |
| parent | Update for latest nightly 2018-06-09 (#70) (diff) | |
| parent | Update for nightly-2018-08-18 (diff) | |
| download | ctru-rs-15cb3c1e91842a68a8e50e1e1a42aefab13cc25e.tar.xz ctru-rs-15cb3c1e91842a68a8e50e1e1a42aefab13cc25e.zip | |
Merge pull request #73 from FenrirWolf/update-2018-08-18
Update for nightly-2018-08-18
Diffstat (limited to 'ctr-std/src/collections/hash/table.rs')
| -rw-r--r-- | ctr-std/src/collections/hash/table.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ctr-std/src/collections/hash/table.rs b/ctr-std/src/collections/hash/table.rs index d997fb2..2b31918 100644 --- a/ctr-std/src/collections/hash/table.rs +++ b/ctr-std/src/collections/hash/table.rs @@ -8,7 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use alloc::{Global, Alloc, Layout, LayoutErr, CollectionAllocErr, oom}; +use alloc::{Global, Alloc, Layout, LayoutErr, handle_alloc_error}; +use collections::CollectionAllocErr; use hash::{BuildHasher, Hash, Hasher}; use marker; use mem::{size_of, needs_drop}; @@ -699,7 +700,7 @@ impl<K, V> RawTable<K, V> { // point into it. let (layout, _) = calculate_layout::<K, V>(capacity)?; let buffer = Global.alloc(layout).map_err(|e| match fallibility { - Infallible => oom(layout), + Infallible => handle_alloc_error(layout), Fallible => e, })?; @@ -1124,7 +1125,7 @@ unsafe impl<#[may_dangle] K, #[may_dangle] V> Drop for RawTable<K, V> { let (layout, _) = calculate_layout::<K, V>(self.capacity()) .unwrap_or_else(|_| unsafe { hint::unreachable_unchecked() }); unsafe { - Global.dealloc(NonNull::new_unchecked(self.hashes.ptr()).as_opaque(), layout); + Global.dealloc(NonNull::new_unchecked(self.hashes.ptr()).cast(), layout); // Remember how everything was allocated out of one buffer // during initialization? We only need one call to free here. } |