mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Add regression test for ICE #4579
This commit is contained in:
parent
157edad620
commit
75d951e1ad
1 changed files with 13 additions and 0 deletions
13
tests/ui/ice-4579.rs
Normal file
13
tests/ui/ice-4579.rs
Normal 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]) };
|
||||
},
|
||||
_ => (),
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue