about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-12-19 11:47:12 +0100
committerGitHub <noreply@github.com>2018-12-19 11:47:12 +0100
commit39dc2c4e34f16fdd9d15a89cfc9d82ed60c67b17 (patch)
tree5f54261d2717ecf1f51079b1ffe96444c77de699
parentb08a52c8d4d9ae81e93577e0787aa95e0bd8752f (diff)
parentfca03e01405158c0efd05eba06bd99b12b7b691c (diff)
downloadrust-39dc2c4e34f16fdd9d15a89cfc9d82ed60c67b17.tar.gz
rust-39dc2c4e34f16fdd9d15a89cfc9d82ed60c67b17.zip
Rollup merge of #56907 - rumajo:master, r=kennytm,Centril
Fix grammar in compiler error for array iterators

This fixes a small grammatical mistake in the message the compiler gives when attempting to iterate directly over an array `arr` without calling `arr.iter()` or borrowing `&arr`.
-rw-r--r--src/libcore/iter/iterator.rs2
-rw-r--r--src/test/ui/iterators/array-of-ranges.stderr2
-rw-r--r--src/test/ui/iterators/array.stderr6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs
index c0b83a6868b..f77d8eb6f7c 100644
--- a/src/libcore/iter/iterator.rs
+++ b/src/libcore/iter/iterator.rs
@@ -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}",
diff --git a/src/test/ui/iterators/array-of-ranges.stderr b/src/test/ui/iterators/array-of-ranges.stderr
index 495659720c3..3dbed9a1065 100644
--- a/src/test/ui/iterators/array-of-ranges.stderr
+++ b/src/test/ui/iterators/array-of-ranges.stderr
@@ -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
diff --git a/src/test/ui/iterators/array.stderr b/src/test/ui/iterators/array.stderr
index 582c812a8d6..94731f1c745 100644
--- a/src/test/ui/iterators/array.stderr
+++ b/src/test/ui/iterators/array.stderr
@@ -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
@@ -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
@@ -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