-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
jonas-schievink
added
A-borrow-checker
Area: The borrow checker
A-diagnostics
Area: Messages for errors, warnings, and lints
regression-from-stable-to-nightly
Performance or correctness regression from stable to nightly.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Jul 5, 2020
rustbot
added
the
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
label
Jul 5, 2020
jonas-schievink
added
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
and removed
regression-from-stable-to-nightly
Performance or correctness regression from stable to nightly.
labels
Jul 5, 2020
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
|
LeSeulArtichaut
added
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
and removed
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
labels
Jul 6, 2020
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: