Skip to content

Commit d08d195

Browse files
committed
add test for recent unwind UB issue
1 parent 9a71009 commit d08d195

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tests/panic/oob_subslice.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This once failed with "unwinding past a stack frame that does not allow unwinding",
2+
// fixed by https://github.com/rust-lang/rust/issues/110233.
3+
4+
fn main() {
5+
let x = [1, 2, 3, 4];
6+
let _val = &x[..=4];
7+
}

tests/panic/oob_subslice.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
thread 'main' panicked at 'range end index 5 out of range for slice of length 4', $DIR/oob_subslice.rs:LL:CC
2+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

0 commit comments

Comments
 (0)