]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #51729 - matthewjasper:move-errors, r=nikomatsakis
authorbors <bors@rust-lang.org>
Fri, 29 Jun 2018 12:40:12 +0000 (12:40 +0000)
committerbors <bors@rust-lang.org>
Fri, 29 Jun 2018 12:40:12 +0000 (12:40 +0000)
[NLL] Better move errors

Make a number of changes to improve the quality of NLL cannot move errors.

* Group errors that occur in the same `match` with the same cause.
* Suggest `ref`, `&` or removing `*` to avoid the move.
* Show the place being matched on.

Differences from AST borrowck:

* `&` is suggested over `ref` when matching on a place that can't be moved from.
* Removing `*` is suggested instead of adding `&` when applicable.
* Sub-pattern spans aren't used, this would probably need Spans on Places.

Closes #45699
Closes #46627
Closes #51187
Closes #51189

r? @pnkfelix

1  2 
src/librustc/mir/mod.rs
src/librustc_mir/borrow_check/mod.rs
src/librustc_mir/build/mod.rs

Simple merge
Simple merge
Simple merge