rust/tests/ui/consts/no-ice-from-static-in-const-issue-52060.rs
Ding Xiang Fei 1576a6d618
Stabilize const_refs_to_static
update tests

fix bitwidth-sensitive stderr output

use build-fail for asm tests
2024-09-26 13:21:15 +02:00

10 lines
286 B
Rust

// Regression test for https://github.com/rust-lang/rust/issues/52060
// The compiler shouldn't ICE in this case
static mut A: &'static [u32] = &[1];
static B: [u32; 1] = [0; unsafe { A.len() }];
//~^ ERROR: evaluation of constant value failed
//~| mutable global memory
fn main() {}