]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #52242 - ashtneoi:suggest-ref-mut, r=pnkfelix
authorbors <bors@rust-lang.org>
Fri, 13 Jul 2018 17:08:39 +0000 (17:08 +0000)
committerbors <bors@rust-lang.org>
Fri, 13 Jul 2018 17:08:39 +0000 (17:08 +0000)
NLL: Suggest `ref mut` and `&mut self`

Fixes #51244. Supersedes #51249, I think.

Under the old lexical lifetimes, the compiler provided helpful suggestions about adding `mut` when you tried to mutate a variable bound as `&self` or (explicit) `ref`. NLL doesn't have those suggestions yet. This pull request adds them.

I didn't bother making the help text exactly the same as without NLL, but I can if that's important.

(Originally this was supposed to be part of #51612, but I got bogged down trying to fit everything in one PR.)

1  2 
src/librustc_mir/borrow_check/mod.rs

Simple merge