mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
b97036628f
Previously, using a zero-length SIMD type in an extern static would cause an internal compiler error. Now it properly emits a diagnostic error instead of panicking.
14 lines
331 B
Rust
14 lines
331 B
Rust
#![feature(repr_simd)]
|
|
|
|
#[repr(simd)]
|
|
struct Simd<T, const N: usize>([T; N]);
|
|
|
|
unsafe extern "C" {
|
|
static VAR: Simd<u8, 0>;
|
|
//~^ ERROR the SIMD type `Simd<u8, 0>` has zero elements
|
|
static VAR2: Simd<u8, 1_000_000>;
|
|
//~^ ERROR the SIMD type `Simd<u8, 1000000>` has more elements than the limit 32768
|
|
}
|
|
|
|
fn main() {}
|