-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Strange span in borrow error in nested match. #74050
Labels
A-borrow-checker
Area: The borrow checker
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
P-medium
Medium priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Without using any methods: fn main() {
let _arg = match Some(()) {
Some(arg) => {
match Some(&arg) {
Some(s) => s,
None => return,
}
} // <- this is probably the desired location
None => return,
};
} results in
|
Assigning
|
This should probably be rust/src/librustc_parse/parser/expr.rs Line 1793 in 5d429f3
|
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jul 8, 2020
Correctly mark the ending span of a match arm Closes rust-lang#74050 r? @matthewjasper
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jul 8, 2020
Correctly mark the ending span of a match arm Closes rust-lang#74050 r? @matthewjasper
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jul 9, 2020
Correctly mark the ending span of a match arm Closes rust-lang#74050 r? @matthewjasper
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jul 9, 2020
Correctly mark the ending span of a match arm Closes rust-lang#74050 r? @matthewjasper
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jul 10, 2020
Correctly mark the ending span of a match arm Closes rust-lang#74050 r? @matthewjasper
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jul 10, 2020
Correctly mark the ending span of a match arm Closes rust-lang#74050 r? @matthewjasper
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jul 10, 2020
Correctly mark the ending span of a match arm Closes rust-lang#74050 r? @matthewjasper
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jul 10, 2020
Correctly mark the ending span of a match arm Closes rust-lang#74050 r? @matthewjasper
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jul 11, 2020
Correctly mark the ending span of a match arm Closes rust-lang#74050 r? @matthewjasper
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jul 11, 2020
Correctly mark the ending span of a match arm Closes rust-lang#74050 r? @matthewjasper
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-borrow-checker
Area: The borrow checker
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
P-medium
Medium priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
Previously, in 1.36 or earlier, it presented an error like this:
Starting with 1.37, the "dropped here while still borrowed" message points to an odd location:
The earlier error looks more correct to me.
Bisected the change to nightly-2019-05-24, I would guess maybe it is #60174.
The text was updated successfully, but these errors were encountered: