forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#106740 - petar-dambovaliev:float-iterator-h…
…int, r=Nilstrieb Adding a hint on iterator type errors Issue reference rust-lang#106728 - [x] add a case in the attribute - [x] add a test closes rust-lang#106728
- Loading branch information
Showing
4 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// #106728 | ||
|
||
fn main() { | ||
for i in 0.2 { | ||
//~^ ERROR `{float}` is not an iterator | ||
//~| `{float}` is not an iterator | ||
//~| NOTE in this expansion of desugaring of `for` loop | ||
//~| NOTE in this expansion of desugaring of `for` loop | ||
//~| NOTE in this expansion of desugaring of `for` loop | ||
//~| NOTE in this expansion of desugaring of `for` loop | ||
//~| NOTE if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` | ||
//~| NOTE required for `{float}` to implement `IntoIterator` | ||
println!(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error[E0277]: `{float}` is not an iterator | ||
--> $DIR/float_iterator_hint.rs:4:14 | ||
| | ||
LL | for i in 0.2 { | ||
| ^^^ `{float}` is not an iterator | ||
| | ||
= help: the trait `Iterator` is not implemented for `{float}` | ||
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end` | ||
= note: required for `{float}` to implement `IntoIterator` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters