Skip to content

Suggest missing . for typo in ranges #101883

Open
@Rageking8

Description

@Rageking8

Given the following code: link

fn main() {
    for i in 0.10 {

    }
}

The current output is:

Compiling playground v0.0.1 (/playground)
error[[E0277]](https://doc.rust-lang.org/nightly/error-index.html#E0277): `{float}` is not an iterator
 --> src/main.rs:2:14
  |
2 |     for i in 0.10 {
  |              ^^^^ `{float}` is not an iterator
  |
  = help: the trait `Iterator` is not implemented for `{float}`
  = note: required for `{float}` to implement `IntoIterator`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `playground` due to previous error

Ideally the output should suggest adding a . due to the typo. Thanks.

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`D-papercutDiagnostics: An error or lint that needs small tweaks.T-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