Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra space when suggesting to remove token #132969

Closed
Kyuuhachi opened this issue Nov 12, 2024 · 0 comments · Fixed by #132996
Closed

Extra space when suggesting to remove token #132969

Kyuuhachi opened this issue Nov 12, 2024 · 0 comments · Fixed by #132996
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Kyuuhachi
Copy link
Contributor

Code

fn main() {
  for let i in 0..=10 {
    println!("{}", i);
  }
}

Current output

error: expected pattern, found `let`
 --> src/main.rs:2:7
  |
2 |   for let i in 0..=10 {
  |       ^^^
  |
help: remove the unnecessary `let` keyword
  |
2 -   for let i in 0..=10 {
2 +   for  i in 0..=10 {
  |

Desired output

2 -   for let i in 0..=10 {
2 +   for i in 0..=10 {

Rationale and extra context

No response

Other cases

Rust Version

Nightly channel

Build using the Nightly version: 1.84.0-nightly

(2024-11-11 81eef2d362a6f03db6f8)

[Used playground]

Anything else?

No response

@Kyuuhachi Kyuuhachi added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 12, 2024
@bors bors closed this as completed in e6b3a55 Nov 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 14, 2024
Rollup merge of rust-lang#132996 - clubby789:unn-let-space, r=jieyouxu

Trim extra space when suggesting removing bad `let`

Fixes rust-lang#132969
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant