diff options
| author | kennytm <kennytm@gmail.com> | 2017-11-28 03:16:44 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-28 03:16:44 +0800 |
| commit | 26330b17572b106c6c1ce6c7e049b0dc25ee058e (patch) | |
| tree | 0e59002145ecab7b73e0b073fb149e476e09e54a /src/test/incremental/thinlto | |
| parent | aa99bd96fdbbe00e5aa96927c5edba908095527f (diff) | |
| parent | 1be38e0316398f3dd409bdc4e1d14f33186599cb (diff) | |
| download | rust-26330b17572b106c6c1ce6c7e049b0dc25ee058e.tar.gz rust-26330b17572b106c6c1ce6c7e049b0dc25ee058e.zip | |
Rollup merge of #46231 - ritiek:verbs, r=arielb1
MIR: Fix value moved diagnose messages
#45960. I believe this will take a different approach. Simply replacing all nouns to verbs (`desired_action`) messes up the message `use of moved value` (although fixes the message in original issue). Here is what happens:
<pre>
$ rustc -Zborrowck-mir src/test/ui/borrowck/borrowck-reinit.rs
error[E0382]: <b>used</b> of moved value: `x` (Mir)
--> src/test/ui/borrowck/borrowck-reinit.rs:18:16
|
17 | drop(x);
| - value moved here
18 | let _ = (1,x);
| ^ value used here after move
error: aborting due to 2 previous errors
</pre>
(Notice: *"**used** of moved value: `x`"* instead of *"**use**"*)
Which does not seem to be okay.
After experimenting a bit, it looks like [`report_use_of_moved_value()`](https://github.com/rust-lang/rust/blob/1dc0b573e7ce4314eb196b21b7e0ea4a1bf1f673/src/librustc_mir/borrow_check.rs#L1319) tries to handle both these messages by taking in only one form of`desired_action`.
These messages rise from: *"[{noun} of moved value](https://github.com/rust-lang/rust/blob/1dc0b573e7ce4314eb196b21b7e0ea4a1bf1f673/src/librustc_mir/borrow_check.rs#L1338-L1342)"* and *"[value {verb} here after move](https://github.com/rust-lang/rust/blob/1dc0b573e7ce4314eb196b21b7e0ea4a1bf1f673/src/librustc_mir/borrow_check.rs#L1343)"*.
This PR fixes *"value {verb} here after move"* type messages by passing a corresponding verb (`desired_action`) instead of the original noun.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
