Skip to content

The old errors always show the same line for borrowck messages #33559

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

Closed
nagisa opened this issue May 11, 2016 · 2 comments
Closed

The old errors always show the same line for borrowck messages #33559

nagisa opened this issue May 11, 2016 · 2 comments
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@nagisa
Copy link
Member

nagisa commented May 11, 2016

old:

src/sparsevec.rs:49:9: 49:15 error: cannot borrow `self.0` as mutable more than once at a time [E0499]
src/sparsevec.rs:49         self.0.extend((0..(i - len)).map(|_| None));
                            ^~~~~~
src/sparsevec.rs:49             match self.0.get_mut(i) {
                                      ^~~~~~
src/sparsevec.rs:49     }
                        ^
src/sparsevec.rs:49:9: 49:15 help: run `rustc --explain E0499` to see a detailed explanation

new:

error: cannot borrow `self.0` as mutable more than once at a time [--explain E0499]
   --> src/sparsevec.rs:49:9
38  |>             match self.0.get_mut(i) {
    |>                   ------ first mutable borrow occurs here
...
49  |>         self.0.extend((0..(i - len)).map(|_| None));
    |>         ^^^^^^ second mutable borrow occurs here
50  |>         self.get_mut_or_put(i, f)
51  |>     }
    |>     - first borrow ends here
@nagisa nagisa added the A-diagnostics Area: Messages for errors, warnings, and lints label May 11, 2016
@nagisa
Copy link
Member Author

nagisa commented May 11, 2016

cc @nikomatsakis @jonathandturner

@sophiajt sophiajt self-assigned this May 11, 2016
sophiajt pushed a commit to sophiajt/rust that referenced this issue May 17, 2016
bors added a commit that referenced this issue May 19, 2016
Fix for old school error issues, improvements to new school

This PR:
* Fixes some old school error issues, specifically #33559, #33543, #33366
* Improves wording borrowck errors with match patterns
* De-emphasize multi-line spans, so we don't color the single source character when we're trying to say "span starts here"
* Rollup of #33392 (which should help fix #33390)

r? @nikomatsakis
@sophiajt
Copy link
Contributor

This should be fixed with #33688

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

2 participants