Skip to content

Commit 4188057

Browse files
committed
Add regression test for ICE #4579
1 parent 406e89a commit 4188057

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/ui/ice-4579.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![allow(clippy::single_match)]
2+
3+
use std::ptr;
4+
5+
fn main() {
6+
match Some(0_usize) {
7+
Some(_) => {
8+
let s = "012345";
9+
unsafe { ptr::read(s.as_ptr().offset(1) as *const [u8; 5]) };
10+
},
11+
_ => (),
12+
};
13+
}

0 commit comments

Comments
 (0)