Commit Graph

4 Commits

Author SHA1 Message Date
Esteban Küber
274b7e49e0 Suggest borrowing for loop head on move error 2019-05-24 18:23:43 -07:00
Matthew Jasper
8eef102270 update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
Andy Russell
b6f148c8bd
hide --explain hint if error has no extended info 2019-04-18 13:29:28 -04:00
Esteban Küber
ae883dc826 When moving out of a for loop head, suggest borrowing it
When encountering code like the following, suggest borrowing the for loop
head to avoid moving it into the for loop pattern:

```
fn main() {
    let a = vec![1, 2, 3];
    for i in &a {
        for j in a {
            println!("{} * {} = {}", i, j, i * j);
        }
    }
}
```
2019-03-24 11:46:13 -07:00