summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/ub-slice-get-unchecked.rs
blob: d9a74b4f3e24cbfc8565bd43abf749af4540a005 (plain)
1
2
3
4
5
6
7
8
9
#![feature(const_slice_index)]

const A: [(); 5] = [(), (), (), (), ()];

// Since the indexing is on a ZST, the addresses are all fine,
// but we should still catch the bad range.
const B: &[()] = unsafe { A.get_unchecked(3..1) };

fn main() {}