]> git.lizzy.rs Git - rust.git/blob - tests/run-pass/ice-1782.rs
Adapt run-pass tests to the tool_lints
[rust.git] / tests / run-pass / ice-1782.rs
1 #![allow(dead_code, unused_variables)]
2
3 /// Should not trigger an ICE in `SpanlessEq` / `consts::constant`
4 ///
5 /// Issue: https://github.com/rust-lang-nursery/rust-clippy/issues/1782
6
7 use std::{mem, ptr};
8
9 fn spanless_eq_ice() {
10     let txt = "something";
11     match txt {
12         "something" => unsafe { ptr::write(ptr::null_mut() as *mut u32, mem::transmute::<[u8; 4], _>([0, 0, 0, 255])) },
13         _ => unsafe { ptr::write(ptr::null_mut() as *mut u32, mem::transmute::<[u8; 4], _>([13, 246, 24, 255])) },
14     }
15 }
16
17 fn main() {}