diff options
Diffstat (limited to 'src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs')
-rw-r--r-- | src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs b/src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs new file mode 100644 index 000000000..ad8909618 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs @@ -0,0 +1,14 @@ +// compile-flags:-C panic=abort + +#![no_std] +#![no_main] + +use core::alloc::Layout; + +#[alloc_error_handler] //~ ERROR the `#[alloc_error_handler]` attribute is an experimental feature +fn oom(info: Layout) -> ! { + loop {} +} + +#[panic_handler] +fn panic(_: &core::panic::PanicInfo) -> ! { loop {} } |