Halt and catch fire: Difference between revisions
Added a section for Rust that just calls panic!() with an empty input string.
(Updated Liberty BASIC's example) |
(Added a section for Rust that just calls panic!() with an empty input string.) |
||
Line 428:
<pre>
1:in `<main>': unhandled exception
</pre>
=={{header|Rust}}==
Rust provides the panic! macro for stopping execution when encountering unrecoverable errors. This results in a crash, rather than a normal exit.
<lang rust>
fn main(){panic!("");}
</lang>
{{out}}
<pre>
thread 'main' panicked at '', src\main.rs:1:12
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
</pre>
|