update array missing IntoIterator msg

This commit is contained in:
lcnr 2021-02-28 12:42:56 +01:00
parent 5e65467eff
commit addc51a85f
3 changed files with 20 additions and 20 deletions

View File

@ -81,8 +81,8 @@ fn _assert_is_object_safe(_: &dyn Iterator<Item = ()>) {}
), ),
on( on(
_Self = "[]", _Self = "[]",
label = "borrow the array with `&` or call `.iter()` on it to iterate over it", label = "arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`",
note = "arrays are not iterators, but slices like the following are: `&[1, 2, 3]`" note = "see <https://github.com/rust-lang/rust/pull/65819> for more details"
), ),
on( on(
_Self = "{integral}", _Self = "{integral}",

View File

@ -13,10 +13,10 @@ error[E0277]: `[RangeInclusive<{integer}>; 1]` is not an iterator
--> $DIR/array-of-ranges.rs:4:14 --> $DIR/array-of-ranges.rs:4:14
| |
LL | for _ in [0..=1] {} LL | for _ in [0..=1] {}
| ^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it | ^^^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
| |
= help: the trait `Iterator` is not implemented for `[RangeInclusive<{integer}>; 1]` = help: the trait `Iterator` is not implemented for `[RangeInclusive<{integer}>; 1]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]` = note: see <https://github.com/rust-lang/rust/pull/65819> for more details
= note: required because of the requirements on the impl of `IntoIterator` for `[RangeInclusive<{integer}>; 1]` = note: required because of the requirements on the impl of `IntoIterator` for `[RangeInclusive<{integer}>; 1]`
= note: required by `into_iter` = note: required by `into_iter`
@ -24,10 +24,10 @@ error[E0277]: `[RangeFrom<{integer}>; 1]` is not an iterator
--> $DIR/array-of-ranges.rs:6:14 --> $DIR/array-of-ranges.rs:6:14
| |
LL | for _ in [0..] {} LL | for _ in [0..] {}
| ^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it | ^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
| |
= help: the trait `Iterator` is not implemented for `[RangeFrom<{integer}>; 1]` = help: the trait `Iterator` is not implemented for `[RangeFrom<{integer}>; 1]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]` = note: see <https://github.com/rust-lang/rust/pull/65819> for more details
= note: required because of the requirements on the impl of `IntoIterator` for `[RangeFrom<{integer}>; 1]` = note: required because of the requirements on the impl of `IntoIterator` for `[RangeFrom<{integer}>; 1]`
= note: required by `into_iter` = note: required by `into_iter`
@ -35,10 +35,10 @@ error[E0277]: `[RangeTo<{integer}>; 1]` is not an iterator
--> $DIR/array-of-ranges.rs:8:14 --> $DIR/array-of-ranges.rs:8:14
| |
LL | for _ in [..1] {} LL | for _ in [..1] {}
| ^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it | ^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
| |
= help: the trait `Iterator` is not implemented for `[RangeTo<{integer}>; 1]` = help: the trait `Iterator` is not implemented for `[RangeTo<{integer}>; 1]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]` = note: see <https://github.com/rust-lang/rust/pull/65819> for more details
= note: required because of the requirements on the impl of `IntoIterator` for `[RangeTo<{integer}>; 1]` = note: required because of the requirements on the impl of `IntoIterator` for `[RangeTo<{integer}>; 1]`
= note: required by `into_iter` = note: required by `into_iter`
@ -46,10 +46,10 @@ error[E0277]: `[RangeToInclusive<{integer}>; 1]` is not an iterator
--> $DIR/array-of-ranges.rs:10:14 --> $DIR/array-of-ranges.rs:10:14
| |
LL | for _ in [..=1] {} LL | for _ in [..=1] {}
| ^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it | ^^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
| |
= help: the trait `Iterator` is not implemented for `[RangeToInclusive<{integer}>; 1]` = help: the trait `Iterator` is not implemented for `[RangeToInclusive<{integer}>; 1]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]` = note: see <https://github.com/rust-lang/rust/pull/65819> for more details
= note: required because of the requirements on the impl of `IntoIterator` for `[RangeToInclusive<{integer}>; 1]` = note: required because of the requirements on the impl of `IntoIterator` for `[RangeToInclusive<{integer}>; 1]`
= note: required by `into_iter` = note: required by `into_iter`
@ -79,10 +79,10 @@ error[E0277]: `[std::ops::Range<{integer}>; 2]` is not an iterator
--> $DIR/array-of-ranges.rs:19:14 --> $DIR/array-of-ranges.rs:19:14
| |
LL | for _ in [0..1, 2..3] {} LL | for _ in [0..1, 2..3] {}
| ^^^^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it | ^^^^^^^^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
| |
= help: the trait `Iterator` is not implemented for `[std::ops::Range<{integer}>; 2]` = help: the trait `Iterator` is not implemented for `[std::ops::Range<{integer}>; 2]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]` = note: see <https://github.com/rust-lang/rust/pull/65819> for more details
= note: required because of the requirements on the impl of `IntoIterator` for `[std::ops::Range<{integer}>; 2]` = note: required because of the requirements on the impl of `IntoIterator` for `[std::ops::Range<{integer}>; 2]`
= note: required by `into_iter` = note: required by `into_iter`
@ -90,10 +90,10 @@ error[E0277]: `[RangeInclusive<{integer}>; 1]` is not an iterator
--> $DIR/array-of-ranges.rs:21:14 --> $DIR/array-of-ranges.rs:21:14
| |
LL | for _ in [0..=1] {} LL | for _ in [0..=1] {}
| ^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it | ^^^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
| |
= help: the trait `Iterator` is not implemented for `[RangeInclusive<{integer}>; 1]` = help: the trait `Iterator` is not implemented for `[RangeInclusive<{integer}>; 1]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]` = note: see <https://github.com/rust-lang/rust/pull/65819> for more details
= note: required because of the requirements on the impl of `IntoIterator` for `[RangeInclusive<{integer}>; 1]` = note: required because of the requirements on the impl of `IntoIterator` for `[RangeInclusive<{integer}>; 1]`
= note: required by `into_iter` = note: required by `into_iter`

View File

@ -2,10 +2,10 @@ error[E0277]: `[{integer}; 2]` is not an iterator
--> $DIR/array.rs:2:14 --> $DIR/array.rs:2:14
| |
LL | for _ in [1, 2] {} LL | for _ in [1, 2] {}
| ^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it | ^^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
| |
= help: the trait `Iterator` is not implemented for `[{integer}; 2]` = help: the trait `Iterator` is not implemented for `[{integer}; 2]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]` = note: see <https://github.com/rust-lang/rust/pull/65819> for more details
= note: required because of the requirements on the impl of `IntoIterator` for `[{integer}; 2]` = note: required because of the requirements on the impl of `IntoIterator` for `[{integer}; 2]`
= note: required by `into_iter` = note: required by `into_iter`
@ -13,10 +13,10 @@ error[E0277]: `[{integer}; 2]` is not an iterator
--> $DIR/array.rs:5:14 --> $DIR/array.rs:5:14
| |
LL | for _ in x {} LL | for _ in x {}
| ^ borrow the array with `&` or call `.iter()` on it to iterate over it | ^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
| |
= help: the trait `Iterator` is not implemented for `[{integer}; 2]` = help: the trait `Iterator` is not implemented for `[{integer}; 2]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]` = note: see <https://github.com/rust-lang/rust/pull/65819> for more details
= note: required because of the requirements on the impl of `IntoIterator` for `[{integer}; 2]` = note: required because of the requirements on the impl of `IntoIterator` for `[{integer}; 2]`
= note: required by `into_iter` = note: required by `into_iter`
@ -24,10 +24,10 @@ error[E0277]: `[{float}; 2]` is not an iterator
--> $DIR/array.rs:7:14 --> $DIR/array.rs:7:14
| |
LL | for _ in [1.0, 2.0] {} LL | for _ in [1.0, 2.0] {}
| ^^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it | ^^^^^^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
| |
= help: the trait `Iterator` is not implemented for `[{float}; 2]` = help: the trait `Iterator` is not implemented for `[{float}; 2]`
= note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]` = note: see <https://github.com/rust-lang/rust/pull/65819> for more details
= note: required because of the requirements on the impl of `IntoIterator` for `[{float}; 2]` = note: required because of the requirements on the impl of `IntoIterator` for `[{float}; 2]`
= note: required by `into_iter` = note: required by `into_iter`