From f67453729c19b435686c94936d8145051e7f1284 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 24 May 2018 12:03:05 -0700 Subject: std: Ensure OOM is classified as `nounwind` OOM can't unwind today, and historically it's been optimized as if it can't unwind. This accidentally regressed with recent changes to the OOM handler, so this commit adds in a codegen test to assert that everything gets optimized away after the OOM function is approrpiately classified as nounwind Closes #50925 --- src/liballoc/alloc.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/liballoc/alloc.rs') diff --git a/src/liballoc/alloc.rs b/src/liballoc/alloc.rs index 79607b06f94..4ae8fc649dd 100644 --- a/src/liballoc/alloc.rs +++ b/src/liballoc/alloc.rs @@ -133,6 +133,7 @@ pub(crate) unsafe fn box_free(ptr: Unique) { } } +#[rustc_allocator_nounwind] pub fn oom() -> ! { extern { #[lang = "oom"] -- cgit 1.4.1-3-g733a5