From 3abff3cb7a6e67486f2ec5ebea2ad5c49a6f525c Mon Sep 17 00:00:00 2001 From: laurens Date: Sun, 21 Jun 2020 17:14:48 +0200 Subject: [PATCH] Add panic example --- panic/Cargo.toml | 17 +++++++++++++++++ panic/src/main.rs | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 panic/Cargo.toml create mode 100644 panic/src/main.rs diff --git a/panic/Cargo.toml b/panic/Cargo.toml new file mode 100644 index 0000000..b855923 --- /dev/null +++ b/panic/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "panic" +version = "0.1.0" +authors = ["laurens "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] + +# Instead of unwinding on panic, +# meaning we walk back up the stack and clean up +# the data of every function, we abort immediatelly +# and let the underlying OS cleanup for us. +# This is usefull if you want to keep program binary as small as possible +[profile.release] +panic = 'abort' \ No newline at end of file diff --git a/panic/src/main.rs b/panic/src/main.rs new file mode 100644 index 0000000..38b14dc --- /dev/null +++ b/panic/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + panic!("panicking furiously"); +}