]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #86815 - FabianWolff:issue-84210, r=varkor
authorbors <bors@rust-lang.org>
Mon, 12 Jul 2021 01:00:43 +0000 (01:00 +0000)
committerbors <bors@rust-lang.org>
Mon, 12 Jul 2021 01:00:43 +0000 (01:00 +0000)
commite97c29bda238cf55ddd7eec772deb823364b1846
tree28e24188a597bb5d699e9e135d09868c0d1b6788
parent54aaca862374a8f296402822ec47d4f1586d54e3
parent5eb83f4ec3761b69e839f364e127b8c307f6e196
Auto merge of #86815 - FabianWolff:issue-84210, r=varkor

Improve error reporting for modifications behind `&` references

I had a look at #84210 and noticed that #85823 has effectively already fixed #84210.

However, the string matching in #85823 is _very_ crude and already breaks down when a variable name starts with `mut`. I have made this a bit more robust; further improvements could definitely be made but are complicated by the lack of information provided by an earlier pass:
https://github.com/rust-lang/rust/blob/ce331ee6ee010438d1a58c7da8ced4f26d69a20e/compiler/rustc_mir_build/src/build/matches/mod.rs#L2103-L2107

I have also fixed a missing comma in the error message.