]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #47124 - estebank:loan-paths, r=nikomatsakis
authorbors <bors@rust-lang.org>
Thu, 4 Jan 2018 05:52:39 +0000 (05:52 +0000)
committerbors <bors@rust-lang.org>
Thu, 4 Jan 2018 05:52:39 +0000 (05:52 +0000)
Reword reason for move note

On move errors, when encountering an enum variant, be more ambiguous and do not refer to the type on the cause note, to avoid referring to `(maybe as std::prelude::v1::Some).0`, and instead refer to `the value`.

Sidesteps part of the problem with #41962:

```
error[E0382]: use of partially moved value: `maybe`
 --> file.rs:5:30
  |
5 |         if let Some(thing) = maybe {
  |                     -----    ^^^^^ value used here after move
  |                     |
  |                     value moved here
  = note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `(maybe as std::prelude::v1::Some).0`
 --> file.rs:5:21
  |
5 |         if let Some(thing) = maybe {
  |                     ^^^^^ value moved here in previous iteration of loop
  = note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait

error: aborting due to 2 previous errors
```

Previous discussion: #44360

r? @arielb1

1  2 
src/librustc_borrowck/borrowck/mod.rs

Simple merge