RosettaCodeData/Task/Program-termination/Rust/program-termination-4.rs

13 lines
251 B
Rust
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
use std::thread;
fn main() {
println!("The program is running");
thread::spawn(move|| {
println!("This is the second thread");
panic!("A runtime panic occured");
}).join();
println!("This line should be printed");
}