Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error message when trying to move from an Rc or Arc is ungreat #54703

Merged
merged 2 commits into from
Oct 5, 2018

Commits on Oct 1, 2018

  1. Introduce language items for Arc and Rc.

    This commit introduces language items for `Arc` and `Rc` so that types
    can later be checked to be `Arc` or `Rc` in the NLL borrow checker. The
    `lang` attribute is currently limited to `stage1` as it requires a
    compiler built with knowledge of the expected language items.
    davidtwco committed Oct 1, 2018
    Configuration menu
    Copy the full SHA
    da4a120 View commit details
    Browse the repository at this point in the history
  2. 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`
    ```
    davidtwco committed Oct 1, 2018
    Configuration menu
    Copy the full SHA
    8c6d08b View commit details
    Browse the repository at this point in the history