]> git.lizzy.rs Git - rust.git/commit
Auto merge of #53147 - ashtneoi:dont-suggest-ref, r=estebank
authorbors <bors@rust-lang.org>
Thu, 16 Aug 2018 08:45:32 +0000 (08:45 +0000)
committerbors <bors@rust-lang.org>
Thu, 16 Aug 2018 08:45:32 +0000 (08:45 +0000)
commit142bb27373126edf8367f526358b6c72ecf1d8df
tree9dc2407e9dac4eb50718baddcd89a72903f64bbe
parent996e26c23f3953a27e4e9b6f46ca474da14d3531
parent0023dd9ba1f242c81042460e5ec6876bd93afdbf
Auto merge of #53147 - ashtneoi:dont-suggest-ref, r=estebank

For move errors, suggest match ergonomics instead of `ref`

Partially fixes issue #52423. Also makes errors and suggestions more consistent between move-from-place and move-from-value errors.

Limitations:
- Only the first pattern in a match arm can have a "consider removing this borrow operator" suggestion.
- Suggestions don't always compile as-is (see the TODOs in the test for details).

Sorry for the really long test. I wanted to make sure I handled every case I could think of, and it turned out there were a lot of them.

Questions:
- Is there any particular applicability I should set on those suggestions?
- Are the notes about the `Copy` trait excessive?