rust/tests/ui/binding/const-param.stderr
Esteban Küber 253eb95d45 Tweak output of some const pattern errors
- Add primary span labels.
- Point at const generic parameter used as pattern.
- Point at statics used as pattern.
- Point at let bindings used in const pattern.
2024-12-04 20:29:36 +00:00

13 lines
378 B
Plaintext

error[E0158]: constant parameters cannot be referenced in patterns
--> $DIR/const-param.rs:5:9
|
LL | fn check<const N: usize>() {
| -------------- constant defined here
LL | match 1 {
LL | N => {}
| ^ can't be used in patterns
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0158`.