Add regression test for ICE #4579

This commit is contained in:
flip1995 2019-09-27 15:36:20 +02:00
parent 157edad620
commit 75d951e1ad
No known key found for this signature in database
GPG key ID: 01C836B640FFDFB1

13
tests/ui/ice-4579.rs Normal file
View file

@ -0,0 +1,13 @@
#![allow(clippy::single_match)]
use std::ptr;
fn main() {
match Some(0_usize) {
Some(_) => {
let s = "012345";
unsafe { ptr::read(s.as_ptr().offset(1) as *const [u8; 5]) };
},
_ => (),
};
}