study_example/error_handle/panic_unrecoverable.rs
1fn call_panic_self() {
2 // thread 'main' panicked at 'test panic error.', src/error_handle/panic_unrecoverable.rs:2:5
3 // note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4 panic!("test panic error.");
5}
6
7fn cause_lib_panic() {
8 let v = vec![12, 23, 43];
9 // thread 'main' panicked at 'index out of bounds: the len is 3 but the index is 10', src/error_handle/panic_unrecoverable.rs:9:5
10 // note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
11 // RUST_BACKTRACE=1 cargo run可以看到完整的堆栈
12 v[10];
13}
14
15pub fn panic_unrecover_error_study() {
16 // call_panic_self();
17 // cause_lib_panic();
18}