You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected to see this happen: Get an error about using non constant values in a constant, with a help pointer showing where to change "let" to "const", like in this example without the mut keyword:
2 | let length: usize = 2;
| ---------- help: consider using `const` instead of `let`: `const length`
Instead, this happened: I get the correct error, but it points to a wrong place to fix, off by one character:
2 | let mut length: usize = 2;
| ------------- help: consider using `const` instead of `let`: `const length`
This means auto correcting it using the rust-analyzer vscode plugin produces invalid code:
error[E0435]: attempt to use a non-constant value in a constant
--> t2.rs:3:19
|
2 | let length: usize = 2;
| ---------- help: consider using `const` instead of `let`: `const length`
3 | let arr = [0; length];
| ^^^^^^ non-constant value
… r=jackh726
Make `span_extend_to_prev_str()` more robust
Fixesrust-lang#91560. The logic in `span_extend_to_prev_str()` is currently quite brittle and fails if there is extra whitespace or something else in between, and it also should return an `Option` but doesn't currently.
… r=jackh726
Make `span_extend_to_prev_str()` more robust
Fixesrust-lang#91560. The logic in `span_extend_to_prev_str()` is currently quite brittle and fails if there is extra whitespace or something else in between, and it also should return an `Option` but doesn't currently.
… r=jackh726
Make `span_extend_to_prev_str()` more robust
Fixesrust-lang#91560. The logic in `span_extend_to_prev_str()` is currently quite brittle and fails if there is extra whitespace or something else in between, and it also should return an `Option` but doesn't currently.
I tried this code:
I expected to see this happen: Get an error about using non constant values in a constant, with a help pointer showing where to change "let" to "const", like in this example without the mut keyword:
Instead, this happened: I get the correct error, but it points to a wrong place to fix, off by one character:
This means auto correcting it using the rust-analyzer vscode plugin produces invalid code:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: