better suggestions

This commit is contained in:
Takayuki Maeda 2021-09-27 00:30:39 +09:00
parent e2aad3fe60
commit 620f480e64
10 changed files with 70 additions and 53 deletions

View file

@ -2,10 +2,7 @@ error[E0277]: the size for values of type `dyn Iterator<Item = &'a mut u8>` cann
--> $DIR/issue-20605.rs:2:17
|
LL | for item in *things { *item = 0 }
| ^^^^^^^
| |
| expected an implementor of trait `IntoIterator`
| help: consider mutably borrowing here: `&mut *things`
| ^^^^^^^ expected an implementor of trait `IntoIterator`
|
= note: the trait bound `dyn Iterator<Item = &'a mut u8>: IntoIterator` is not satisfied
= note: required because of the requirements on the impl of `IntoIterator` for `dyn Iterator<Item = &'a mut u8>`
@ -14,6 +11,10 @@ note: required by `into_iter`
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider mutably borrowing here
|
LL | for item in &mut *things { *item = 0 }
| ++++
error: aborting due to previous error