-
Notifications
You must be signed in to change notification settings - Fork 13.3k
NLL Diagnostic Review 3: missing a note describing the type of the non-Copy moved variable #56654
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
Comments
ui/use/use-after-move-self.nll.stderr
missing a note describing the type of the non-Copy moved variable
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 If we grep in the source, we can find that both the AST borrow checker and the NLL borrow checker have code that is supposed to emit this note, so rather than adding that note, we'll want to improve how we're detecting when to emit it. 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
In that same function, we can see where the diagnostic note should be being added: rust/src/librustc_mir/borrow_check/error_reporting.rs Lines 210 to 224 in 850fc6a
Given we know this note should be being added (because the AST borrow checker has it) then that means one of the conditions between the main body of the function and the diagnostic being emitted isn't robust enough and is stopping the error from being reported. If we look at the rust/src/librustc_mir/borrow_check/error_reporting.rs Lines 1677 to 1690 in 850fc6a
That may be the issue, consider trying to use the 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. |
Add a note describing the type of the non-Copy moved variable Closes rust-lang#56654 r?@davidtwco
Add a note describing the type of the non-Copy moved variable Closes rust-lang#56654 r?@davidtwco
Add a note describing the type of the non-Copy moved variable Closes #56654 r?@davidtwco
The following note is missing on the output of the NLL borrow checker for
ui/use/use-after-move-self.nll.stderr
:The text was updated successfully, but these errors were encountered: