Files
rust/tests/ui/array-slice-vec/eval-array-expr.rs
T
2026-06-18 05:28:05 +02:00

13 lines
349 B
Rust

//! Regression test for <https://github.com/rust-lang/rust/issues/23354>.
//! Check expr in [expr; N] is always being evaluated.
//!
//! This used to trigger an LLVM assertion during compilation
//@ run-fail
//@ error-pattern:panic evaluated
//@ needs-subprocess
#[allow(unused_variables)]
fn main() {
let x = [panic!("panic evaluated"); 2];
}