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/libsyntax/feature_gate.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index cbc421dbd32..e70d93ae85a 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -481,6 +481,9 @@ declare_features! ( // Allows async and await syntax (active, async_await, "1.28.0", Some(50547), None), + + // #[alloc_error_handler] + (active, alloc_error_handler, "1.29.0", Some(51540), None), ); declare_features! ( @@ -1083,6 +1086,11 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG "#[panic_implementation] is an unstable feature", cfg_fn!(panic_implementation))), + ("alloc_error_handler", Normal, Gated(Stability::Unstable, + "alloc_error_handler", + "#[alloc_error_handler] is an unstable feature", + cfg_fn!(alloc_error_handler))), + // Crate level attributes ("crate_name", CrateLevel, Ungated), ("crate_type", CrateLevel, Ungated), -- cgit 1.4.1-3-g733a5