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

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

// Any kind of fn call gets around E0764.
const fn empty_mut() -> &'static mut [()] {
    &mut []
}