Skip to content

Commit fabd0c6

Browse files
committed
Auto merge of #223 - cfallin:export-alloc-error, r=Amanieu
Export AllocError as well as Allocator. This PR re-exports the `AllocError` type alongside `Allocator` and others from the `raw` submodule. This seems to be necessary to implement the `Allocator` trait from outside the crate (and I want to use exported types from this crate so that I don't have to depend on the unstable allocator API directly). It allowed me to instantiate hashbrown hashmaps using `bumpalo` over in bytecodealliance/regalloc.rs#115; I couldn't work out another way to do this. If there is a more direct way, please do let me know! (Thanks for this excellent crate and the configurable allocator interface, in any case!)
2 parents 7648ce9 + c5c01d6 commit fabd0c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/raw/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pub use self::inner::*;
33
#[cfg(feature = "nightly")]
44
mod inner {
55
use crate::alloc::alloc::Layout;
6-
pub use crate::alloc::alloc::{Allocator, Global};
6+
pub use crate::alloc::alloc::{AllocError, Allocator, Global};
77
use core::ptr::NonNull;
88

99
#[allow(clippy::map_err_ignore)]

src/raw/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ cfg_if! {
3232
}
3333

3434
mod alloc;
35-
pub use self::alloc::{do_alloc, Allocator, Global};
35+
pub use self::alloc::{do_alloc, AllocError, Allocator, Global};
3636

3737
mod bitmask;
3838

0 commit comments

Comments
 (0)