]> git.lizzy.rs Git - rust.git/commit
Add special cases for move from `Rc`/`Arc` errors.
authorDavid Wood <david@davidtw.co>
Sun, 30 Sep 2018 19:21:31 +0000 (21:21 +0200)
committerDavid Wood <david@davidtw.co>
Mon, 1 Oct 2018 11:50:22 +0000 (13:50 +0200)
commit8c6d08b71f56541a540d365746aab460862d3149
treee8222734e14ed4c4acd9441c0ad364e323d7bc29
parentda4a12038bac647b8d07211588c21f1ca07c12e3
Add special cases for move from `Rc`/`Arc` errors.

This commit special cases the move out of borrowed content error,
previously:

```
error[E0507]: cannot move out of borrowed content
 --> src/main.rs:7:10
  |
7 |     drop(x.field);
  |          ^ cannot move out of borrowed content
```

to instead mention that it is a move out of a `Rc`/`Arc` which is more
helpful:

```
error[E0507]: cannot move out of an `Rc`
 --> src/main.rs:7:10
  |
7 |     drop(x.field);
  |          ^ cannot move out of an `Rc`
```
src/librustc_mir/borrow_check/move_errors.rs
src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.ast.nll.stderr [new file with mode: 0644]
src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.mir.stderr
src/test/ui/borrowck/borrowck-move-out-of-overloaded-deref.nll.stderr
src/test/ui/nll/issue-52086.rs [new file with mode: 0644]
src/test/ui/nll/issue-52086.stderr [new file with mode: 0644]
src/test/ui/nll/move-errors.stderr