-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
NLL Diagnostic Review 3: missing indication that a "partial move" has occurred #56657
Comments
Here are some mentoring instructions to get started on this issue. If you're reading this and want to give this issue a go, drop a comment here and feel free to ask for any help or clarification on Zulip. If this is your first contribution then there are instructions on getting a local build of the compiler available in the rustc guide. These instructions are up to date as of master being This error is emitted from the rust/src/librustc_mir/util/borrowck_errors.rs Lines 485 to 494 in 850fc6a
If we grep in the source, we can find that it is invoked in the rust/src/librustc_mir/borrow_check/error_reporting.rs Lines 128 to 134 in 850fc6a
Inside that function, we can see where this label is being added: rust/src/librustc_mir/borrow_check/error_reporting.rs Lines 184 to 192 in 850fc6a
In this branch, we'll want to check if the previous move was a partial one (that is, the field we're trying to use and can't had one of its fields moved previously and wasn't itself moved entirely). To do this, we'll want to look at the previous moves of this data - this is already computed by this function here:
For a given rust/src/librustc_mir/borrow_check/error_reporting.rs Lines 144 to 145 in 850fc6a
Given the place that was moved, we want to check if it was a field of the current After checking if, for any If you've got this working then you should run the tests and update any that change correctly and then open a PR with a line saying r? @davidtwco in the description so I'll be assigned to review it. |
hi @davidtwco. I can work on this |
@davidtwco I am going to take a run at this at the suggestion of @Dylan-DPC on the Rust Discord. |
@clintfred how is it going? Have you had some time to work on that issue, maybe? :-) |
@bartsmykla Yes. As this is my first time working on the compiler, it took some time to get set up and build everything. I am able to build and run tests. I am on to trying to grok David's excellent mentor instructions. |
@clintfred You can run Feel free to hop on Zulip and make a new topic if you have questions and someone will get back to you (or just comment here and I'll reply when I see it). |
…stebank Add better error message for partial move closes rust-lang#56657 r? @davidtwco
…stebank Add better error message for partial move closes rust-lang#56657 r? @davidtwco
…stebank Add better error message for partial move closes rust-lang#56657 r? @davidtwco
…stebank Add better error message for partial move closes rust-lang#56657 r? @davidtwco
…stebank Add better error message for partial move closes rust-lang#56657 r? @davidtwco
…stebank Add better error message for partial move closes rust-lang#56657 r? @davidtwco
In
ui/borrowck/borrowck-uninit-field-access.ast.nll.stderr
, the below error should have the labelvalue used here after move
changed tovalue used here after partial move
.rust/src/test/ui/borrowck/borrowck-uninit-field-access.ast.nll.stderr
Lines 17 to 25 in 850fc6a
The text was updated successfully, but these errors were encountered: