rust/tests/ui/const-generics/mgca/struct-ctor-in-array-len.stderr
AprilNEA 8d96e26684
Add regression test for struct ctor used as array repeat count under mGCA
Using a struct constructor (DefKind::Ctor(Struct, Const)) as an array
repeat count with `#![feature(min_generic_const_args)]` used to trigger
an ICE in const alias normalization. Add a regression test to ensure
the compiler produces a proper type error instead of panicking.
2026-02-14 19:44:50 +00:00

19 lines
719 B
Text

warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/struct-ctor-in-array-len.rs:8:12
|
LL | #![feature(min_generic_const_args)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
= note: `#[warn(incomplete_features)]` on by default
error: the constant `S` is not of type `usize`
--> $DIR/struct-ctor-in-array-len.rs:14:14
|
LL | let _b = [0; S];
| ^^^^^^ expected `usize`, found `S`
|
= note: the length of array `[{integer}; S]` must be type `usize`
error: aborting due to 1 previous error; 1 warning emitted