diff options
| author | bors <bors@rust-lang.org> | 2018-06-05 01:47:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-06-05 01:47:13 +0000 |
| commit | f9157f5b869fdb14308eaf6778d01ee3d0e1268a (patch) | |
| tree | dd3773889cae79721fa3cee93c982712543b8680 /src/test/incremental/thinlto | |
| parent | c610be92e2925ab8e789efc835c88247e46c6cbf (diff) | |
| parent | 3303e6847b4e8b413ec65a166337e5f9f8325f28 (diff) | |
| download | rust-f9157f5b869fdb14308eaf6778d01ee3d0e1268a.tar.gz rust-f9157f5b869fdb14308eaf6778d01ee3d0e1268a.zip | |
Auto merge of #51242 - ytausky:mut-ref, r=estebank
Suggest not mutably borrowing a mutable reference This PR would (hopefully) solve #45392. I deviated a bit from @estebank's instructions since the error span only included the borrowed expression (e.g. the `b` in `&mut b`). I also didn't check the mutability of the local binding, since this whole case is concerned with an immutable local. I can see two outstanding questions: 1. `note_immutability_blame` is called in two places, but I only have one test case. I think it covers the call in `report_bckerror`, but I'm not sure how to trigger the call from `report_aliasability_violation`. 2. There is one failing test, where the local binding is `self: &mut Self`. I'm not entirely sure what the correct output should be, but I think the new message should also apply. Unfortunately, since this parameter is parsed differently, its `let_span` covers both the pattern and the type, leading to a wrong suggestion text. I'm not sure how to correctly identify this case.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
