]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/match-test-ptr-null.rs
Merge commit '23d11428de3e973b34a5090a78d62887f821c90e' into clippyup
[rust.git] / src / test / ui / consts / const-eval / match-test-ptr-null.rs
1 fn main() {
2     // Make sure match uses the usual pointer comparison code path -- i.e., it should complain
3     // that pointer comparison is disallowed, not that parts of a pointer are accessed as raw
4     // bytes.
5     let _: [u8; 0] = [4; {
6         match &1 as *const i32 as usize {
7             //~^ ERROR pointers cannot be cast to integers during const eval
8             0 => 42,
9             n => n,
10         }
11     }];
12 }