about summary refs log tree commit diff
path: root/library/compiler-builtins/crates/panic-handler/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/compiler-builtins/crates/panic-handler/src/lib.rs')
-rw-r--r--library/compiler-builtins/crates/panic-handler/src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/library/compiler-builtins/crates/panic-handler/src/lib.rs b/library/compiler-builtins/crates/panic-handler/src/lib.rs
new file mode 100644
index 00000000000..673e005224b
--- /dev/null
+++ b/library/compiler-builtins/crates/panic-handler/src/lib.rs
@@ -0,0 +1,11 @@
+//! This is needed for tests on targets that require a `#[panic_handler]` function
+
+#![feature(no_core)]
+#![no_core]
+
+extern crate core;
+
+#[panic_handler]
+fn panic(_: &core::panic::PanicInfo) -> ! {
+    loop {}
+}