Skip to content

Extra space when suggesting to remove token #132969

Closed
@Kyuuhachi

Description

@Kyuuhachi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions