]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/miri_unleashed/slice_eq.rs
Rollup merge of #98640 - cuviper:stable-rust-analyzer, r=Mark-Simulacrum
[rust.git] / src / test / ui / consts / miri_unleashed / slice_eq.rs
1 // compile-flags: -Zunleash-the-miri-inside-of-you
2 // run-pass
3
4 #![feature(const_raw_ptr_comparison)]
5
6 const EMPTY_SLICE: &[i32] = &[];
7 const EMPTY_EQ: bool = EMPTY_SLICE.as_ptr().guaranteed_eq(&[] as *const _);
8 const EMPTY_EQ2: bool = EMPTY_SLICE.as_ptr().guaranteed_ne(&[] as *const _);
9 const EMPTY_NE: bool = EMPTY_SLICE.as_ptr().guaranteed_ne(&[1] as *const _);
10 const EMPTY_NE2: bool = EMPTY_SLICE.as_ptr().guaranteed_eq(&[1] as *const _);
11
12 fn main() {
13     assert!(!EMPTY_EQ);
14     assert!(!EMPTY_EQ2);
15     assert!(!EMPTY_NE);
16     assert!(!EMPTY_NE2);
17 }