From 239ec7d2dce9c19de16c9ee64addbb834119397c Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 6 Jul 2018 15:49:52 +0200 Subject: Implement #[alloc_error_handler] This to-be-stable attribute is equivalent to `#[lang = "oom"]`. It is required when using the alloc crate without the std crate. It is called by `handle_alloc_error`, which is in turned called by "infallible" allocations APIs such as `Vec::push`. --- src/libcore/alloc.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libcore/alloc.rs') diff --git a/src/libcore/alloc.rs b/src/libcore/alloc.rs index 01221aecb62..b6ac248b79f 100644 --- a/src/libcore/alloc.rs +++ b/src/libcore/alloc.rs @@ -48,6 +48,7 @@ fn size_align() -> (usize, usize) { /// use specific allocators with looser requirements.) #[stable(feature = "alloc_layout", since = "1.28.0")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] +#[cfg_attr(not(stage0), lang = "alloc_layout")] pub struct Layout { // size of the requested block of memory, measured in bytes. size_: usize, -- cgit 1.4.1-3-g733a5