]> git.lizzy.rs Git - rust.git/commit
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)
commit78f24d86b84882a02c15f27768e831d0342a3f5d
tree393f3cb3cdb06825658ae1f00142dc74889f997a
parent608aae904b14efd09b4f95d9f4c3f030e6a34f95
parenta4d46b3d87e9c83ffb78489a513a100e5422ac81
Auto merge of #47124 - estebank:loan-paths, r=nikomatsakis

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
src/librustc_borrowck/borrowck/mod.rs