about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example/subslice-patterns-const-eval.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-08-23 21:39:16 +0000
committerEsteban Küber <esteban@kuber.com.ar>2023-08-23 21:46:18 +0000
commitc1a7af0f2a691c2e74479156475018b497f3c288 (patch)
treea69def51fc3a8a447d56f6daf1d94ff3e91a56b7 /compiler/rustc_codegen_gcc/example/subslice-patterns-const-eval.rs
parentfe5f5912579d02c4e6088c89574493dfa988531a (diff)
downloadrust-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_gcc/example/subslice-patterns-const-eval.rs')
0 files changed, 0 insertions, 0 deletions