-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
Description
The control flow for rustc_typeck::check::check_const_with_ty can end up spitting out an error of the form:
non-constant-expr-for-fixed-len-vec.rs:15:25: 15:26 error: no type for local variable 10
non-constant-expr-for-fixed-len-vec.rs:15 let _x: [isize; n];
With the compiler as it stands today, this is usually coupled with an error of the form:
error: array length constant evaluation error: non-constant path in constant exprbut other changes being made may lead to only the "no type for local variable" message being emitted.
We can do better here, e.g. by passing along knowledge that we are looking at a const-expr and then reporting that local variables simply are invalid within const-exprs.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints