Skip to content

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

Closed
@nagisa

Description

@nagisa

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

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lints

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions