-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
MIR-borrowck: error diagnostics need notes #44596
Comments
Incidentally, someone taking this on may also want to consider incorporating some sort of fix here: nikomatsakis/nll-rfc#9 |
I might be interested in doing this. Since I'm new to rust, any pointer to where I should start ? In particular, in which files am I expected to make changes ? Thanks :) |
@zilbuz I would recommend you join us in https://gitter.im/rust-impl-period/WG-compiler-nll (assuming you have not already). We can give you real time guidance there. But the quick answer to your immediate questions are:
|
I would also be looking into this issue. |
I think there is room for multiple people to hack on this, but it'd be good to coordinate. Ideally @pnkfelix (or maybe I...) would go through the tests and try to make up a bullet list. I don't have time to do this just now, but perhaps if you are actively hacking on this, you could leave a note with which notes you are poking at? Also, I'm not sure quite what @pnkfelix had in mind in terms of writing tests, but I think that for now, anyway, the best strategy is probably to clone the test from |
So for this simple erroneous program here: fn main() {
let i: isize;
println!("{}", false && { i = 5; true });
println!("{}", i); //~ ERROR use of possibly uninitialized variable: `i`
} rustc spits out a lot of junk errors:
I'm going to first try and fix it up so that it only points correctly to the uninitialized |
@KiChjang just to repeat what I said in gitter for the record, it seems that the problem is that we are considering a |
Yeah that |
@KiChjang regarding the spurious errors: yes, those do need fixing too, though I regard that as an orthogonal task to the task described in this issue (which is solely about adding notes to the existing error message diagnostics). I am planning to try to keep track of the work here in some manner (either github issues or a checklist on the Paper document associated with NLL). For now I have just put notes and links onto the Paper document itself. |
MIR-borrowck: Adding notes to E0503 This PR adds notes to the MIR borrowck error E0503. Part of rust-lang#44596
MIR borrowck: Add span labels for E0381 and E0505 Corresponds to `report_use_of_moved` and `report_move_out_when_borrowed`. Part of rust-lang#44596.
Add span label to E0384 for MIR borrowck Corresponds to `report_illegal_reassignment`. Part of #44596.
MIR-borrowck: Adding notes to E0506 This PR adds notes to the MIR borrowck error E0506. Part of #44596
MIR borrowck: move span_label to `borrowck_errors.rs` The calls to `span_label` are moved and factorized for: * E0503 (`cannot_use_when_mutably_borrowed()`) * E0506 (`cannot_assign_to_borrowed()`) Additionnally, the error E0594 (`cannot_assign_static()`) has been factorized between `check_loan.rs` and `borrowc_check.rs`. Part of #44596
MIR borrowck: move span_label to `borrowck_errors.rs` The calls to `span_label` are moved and factorized for: * E0503 (`cannot_use_when_mutably_borrowed()`) * E0506 (`cannot_assign_to_borrowed()`) Additionnally, the error E0594 (`cannot_assign_static()`) has been factorized between `check_loan.rs` and `borrowc_check.rs`. Part of #44596
add notes to report_conflicting_borrow MIR borrowck part of #44596
I think this is no longer true... right? I feel like we should move further work on this error into actionable sub-issues. So just going to close. |
The prototype MIR-borrowck from PR #43108 only emits errors, never any notes.
To achieve parity of error message quality with AST-borrowck, we need to add notes.
(In most cases, one can probably cross-reference the emitted error with the point where that error is emitted in the AST-borrowck, and then figure out how to construct the same note.)
Mentoring instructions here.
The text was updated successfully, but these errors were encountered: