Skip to content

Commit 30bc54f

Browse files
committed
Add regression test for ICE rust-lang#4579
1 parent bca08a6 commit 30bc54f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/ui/ice-4579.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
// ^ No expr_ty for this expr
11+
},
12+
_ => (),
13+
};
14+
}

0 commit comments

Comments
 (0)