Diagnostic for iterator referencing temporary with Drop may suggest an invalid semicolon #82462
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code on rust nightly (current nightly on playground is 2021-02-22 a15f484):
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=286e1d81ecdd9df68dc94e9b1b8ead5f
The current output is:
The suggestion regarding the semicolon is incorrect.
Additionally, it seems a little odd to me that the first half of the sentence beginning "a temporary with access to the immutable borrow is created here ..." is displayed below the second half, "... and the immutable borrow might be used here, when that temporary is dropped and runs the
Drop
code for typeDroppingSlice
".The text was updated successfully, but these errors were encountered: