mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-27 04:08:22 +00:00
In some contexts, const expressions are OK. Add a `here` to the error message to clarify this.
14 lines
410 B
Plaintext
14 lines
410 B
Plaintext
error: unconstrained generic constant
|
|
--> $DIR/trivial-anon-const-use-cases.rs:14:12
|
|
|
|
|
LL | stuff: [u8; { S + 1 }], // `S + 1` is NOT a valid const expression in this context.
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
help: try adding a `where` bound
|
|
|
|
|
LL | struct Y<const S: usize> where [(); { S + 1 }]: {
|
|
| ++++++++++++++++++++++
|
|
|
|
error: aborting due to 1 previous error
|
|
|