mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 11:34:11 +00:00
12 lines
269 B
Rust
12 lines
269 B
Rust
// known-bug: #110395
|
|
|
|
#![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() {}
|