summary refs log tree commit diff
path: root/src/libstd/collections
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-06-19 19:22:12 +0000
committerbors <bors@rust-lang.org>2018-06-19 19:22:12 +0000
commitd692ab406ebab720f99f950ac3e9aba1e01296af (patch)
treedec63b7e24af649d8fc67dc3a838f097a5b0787c /src/libstd/collections
parent6ec1b626ba06b51fc8c23ee1cd7e2788163c2265 (diff)
parent2b789bd0570983e82533f9ed30c80312ac334694 (diff)
downloadrust-d692ab406ebab720f99f950ac3e9aba1e01296af.tar.gz
rust-d692ab406ebab720f99f950ac3e9aba1e01296af.zip
Auto merge of #51543 - SimonSapin:oom, r=SimonSapin
Rename OOM to allocation error

The acronym is not descriptive unless one has seen it before.

* Rename the `oom` function to `handle_alloc_error`. It was **stabilized in 1.28**, so if we do this at all we need to land it this cycle.
* Rename `set_oom_hook` to `set_alloc_error_hook`
* Rename `take_oom_hook` to `take_alloc_error_hook`

Bikeshed: `on` v.s. `for`, `alloc` v.s. `allocator`, `error` v.s. `failure`
Diffstat (limited to 'src/libstd/collections')
-rw-r--r--src/libstd/collections/hash/table.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs
index 55f9f4f7cfe..d14b754ddb6 100644
--- a/src/libstd/collections/hash/table.rs
+++ b/src/libstd/collections/hash/table.rs
@@ -8,7 +8,7 @@
 // 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, CollectionAllocErr, handle_alloc_error};
 use hash::{BuildHasher, Hash, Hasher};
 use marker;
 use mem::{size_of, needs_drop};
@@ -699,7 +699,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,
         })?;