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

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

const fn empty_mut() -> &'static mut [()] {
    unsafe {
        std::slice::from_raw_parts_mut(std::ptr::dangling_mut(), 0)
    }
}