diff options
| author | bors <bors@rust-lang.org> | 2023-08-24 15:05:17 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-08-24 15:05:17 +0000 | 
| commit | aa5dbee3ebff8703456e8be3b5fb368fc68fe0d1 (patch) | |
| tree | d7fa060343e7116d8ef8c1b4badec250b42aa48f /src | |
| parent | 18be2728bd0d59c8fc74311de365a52a2d5e3eee (diff) | |
| parent | c1a7af0f2a691c2e74479156475018b497f3c288 (diff) | |
| download | rust-aa5dbee3ebff8703456e8be3b5fb368fc68fe0d1.tar.gz rust-aa5dbee3ebff8703456e8be3b5fb368fc68fe0d1.zip | |
Auto merge of #115147 - estebank:issue-114311, r=davidtwco
Suggest mutable borrow on read only for-loop that should be mutable
```
error[E0596]: cannot borrow `*test` as mutable, as it is behind a `&` reference
  --> $DIR/suggest-mut-iterator.rs:22:9
   |
LL |     for test in &tests {
   |                 ------ this iterator yields `&` references
LL |         test.add(2);
   |         ^^^^ `test` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: use a mutable iterator instead
   |
LL |     for test in &mut tests {
   |                  +++
```
Fix #114311.
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions
