summaryrefslogtreecommitdiffstats
path: root/src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.rs')
-rw-r--r--src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.rs b/src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.rs
new file mode 100644
index 000000000..49ea3105f
--- /dev/null
+++ b/src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.rs
@@ -0,0 +1,17 @@
+// compile-flags:-C panic=abort
+
+#![feature(alloc_error_handler)]
+#![no_std]
+#![no_main]
+
+struct Layout;
+
+#[alloc_error_handler]
+fn oom(
+ info: Layout, //~ ERROR argument should be `Layout`
+) { //~ ERROR return type should be `!`
+ loop {}
+}
+
+#[panic_handler]
+fn panic(_: &core::panic::PanicInfo) -> ! { loop {} }