fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0596]: cannot borrow `**layer` as mutable, as it is behind a `&` reference 2 --> $DIR/issue-115259-suggest-iter-mut.rs:15:65 3 | 4LL | self.layers.iter().fold(0, |result, mut layer| result + layer.process()) 5 | --------- ^^^^^ `layer` is a `&` reference, so the data it refers to cannot be borrowed as mutable 6 | | 7 | consider changing this binding's type to be: `&mut Box<dyn Layer>` 8 | 9help: you may want to use `iter_mut` here 10 | 11LL | self.layers.iter_mut().fold(0, |result, mut layer| result + layer.process()) 12 | ~~~~~~~~ 13 14error: aborting due to previous error 15 16For more information about this error, try `rustc --explain E0596`.