]> git.lizzy.rs Git - rust.git/blob - tests/ui/crashes/ice-2499.rs
Merge remote-tracking branch 'upstream/master' into rustup
[rust.git] / tests / ui / crashes / ice-2499.rs
1 #![allow(dead_code, clippy::char_lit_as_u8, clippy::needless_bool)]
2
3 /// Should not trigger an ICE in `SpanlessHash` / `consts::constant`
4 ///
5 /// Issue: https://github.com/rust-lang/rust-clippy/issues/2499
6
7 fn f(s: &[u8]) -> bool {
8     let t = s[0] as char;
9
10     match t {
11         'E' | 'W' => {},
12         'T' => {
13             if s[0..4] != ['0' as u8; 4] {
14                 return false;
15             } else {
16                 return true;
17             }
18         },
19         _ => {
20             return false;
21         },
22     }
23     true
24 }
25
26 fn main() {}