Skip to content

Fix grammar in compiler error for array iterators #56907

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

Merged
merged 1 commit into from
Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fn _assert_is_object_safe(_: &dyn Iterator<Item=()>) {}
on(
_Self="[]",
label="borrow the array with `&` or call `.iter()` on it to iterate over it",
note="arrays are not an iterators, but slices like the following are: `&[1, 2, 3]`"
note="arrays are not iterators, but slices like the following are: `&[1, 2, 3]`"
),
on(
_Self="{integral}",
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/iterators/array-of-ranges.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ LL | for _ in [0..1, 2..3] {}
| ^^^^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it
|
= help: the trait `std::iter::Iterator` is not implemented for `[std::ops::Range<{integer}>; 2]`
= note: arrays are not an iterators, but slices like the following are: `&[1, 2, 3]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
= note: required by `std::iter::IntoIterator::into_iter`

error[E0277]: `[std::ops::RangeInclusive<{integer}>; 1]` is not an iterator
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/iterators/array.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | for _ in [1, 2] {}
| ^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it
|
= help: the trait `std::iter::Iterator` is not implemented for `[{integer}; 2]`
= note: arrays are not an iterators, but slices like the following are: `&[1, 2, 3]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
= note: required by `std::iter::IntoIterator::into_iter`

error[E0277]: `[{integer}; 2]` is not an iterator
Expand All @@ -15,7 +15,7 @@ LL | for _ in x {}
| ^ borrow the array with `&` or call `.iter()` on it to iterate over it
|
= help: the trait `std::iter::Iterator` is not implemented for `[{integer}; 2]`
= note: arrays are not an iterators, but slices like the following are: `&[1, 2, 3]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
= note: required by `std::iter::IntoIterator::into_iter`

error[E0277]: `[{float}; 2]` is not an iterator
Expand All @@ -25,7 +25,7 @@ LL | for _ in [1.0, 2.0] {}
| ^^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it
|
= help: the trait `std::iter::Iterator` is not implemented for `[{float}; 2]`
= note: arrays are not an iterators, but slices like the following are: `&[1, 2, 3]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
= note: required by `std::iter::IntoIterator::into_iter`

error: aborting due to 3 previous errors
Expand Down