about summary refs log tree commit diff
path: root/tests/crashes/140123-4.rs
blob: 39042d897ee2896867752e0080a1454715396d71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//@ known-bug: #140123
//@ compile-flags: --crate-type lib

const ICE: [&mut [(); 0]; 2] = [const { empty_mut() }; 2];

const fn empty_mut() -> &'static mut [(); 0] {
    &mut []
}
// https://github.com/rust-lang/rust/issues/140123#issuecomment-2820664450
const ICE2: [&mut [(); 0]; 2] = [const {
    let x = &mut [];
    x
}; 2];