diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2023-08-23 21:39:16 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2023-08-23 21:46:18 +0000 |
| commit | c1a7af0f2a691c2e74479156475018b497f3c288 (patch) | |
| tree | a69def51fc3a8a447d56f6daf1d94ff3e91a56b7 /compiler/rustc_codegen_llvm/src/errors.rs | |
| parent | fe5f5912579d02c4e6088c89574493dfa988531a (diff) | |
| download | rust-c1a7af0f2a691c2e74479156475018b497f3c288.tar.gz rust-c1a7af0f2a691c2e74479156475018b497f3c288.zip | |
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 {
| +++
```
Address #114311.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
