about summary refs log tree commit diff
path: root/tests/ui/panic-handler/panic-handler-with-track-caller.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/panic-handler/panic-handler-with-track-caller.rs')
-rw-r--r--tests/ui/panic-handler/panic-handler-with-track-caller.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/panic-handler/panic-handler-with-track-caller.rs b/tests/ui/panic-handler/panic-handler-with-track-caller.rs
new file mode 100644
index 00000000000..09c94139e16
--- /dev/null
+++ b/tests/ui/panic-handler/panic-handler-with-track-caller.rs
@@ -0,0 +1,14 @@
+//@ compile-flags:-C panic=abort
+//@ only-x86_64
+
+#![no_std]
+#![no_main]
+
+use core::panic::PanicInfo;
+
+#[panic_handler]
+#[track_caller]
+//~^ ERROR `#[panic_handler]` function is not allowed to have `#[track_caller]`
+fn panic(info: &PanicInfo) -> ! {
+    unimplemented!();
+}