Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#41640 - gaurikholkar:master, r=nikomatsakis
Consider changing to & for let bindings rust-lang#40402 This is a fix for rust-lang#40402 For the example ``` fn main() { let v = vec![String::from("oh no")]; let e = v[0]; } ``` It gives ``` error[E0507]: cannot move out of indexed content --> ex1.rs:4:13 | 4 | let e = v[0]; | ^^^^ cannot move out of indexed content | = help: consider changing to `&v[0]` error: aborting due to previous error ``` Another alternative is ``` error[E0507]: cannot move out of indexed content --> ex1.rs:4:13 | 4 | let e = v[0]; | ^^^^ consider changing to `&v[0]` error: aborting due to previous error ``` Also refer to rust-lang#41564 for more details. r? @nikomatsakis
- Loading branch information