This is a reference to help answer this question: โwhat will my Rust program print if something goes wrong?โ
The examples were compiled with Rust 1.76.0. All output in these examples goes to stderr, nothing goes to stdout.
Panic
fn main() { panic!("oh no"); }
thread 'main' panicked at src/bin/panic.rs:2:5: oh no note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace