-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Compiler Suggests Cloning an async
Block
#121547
Labels
A-borrow-checker
Area: The borrow checker
A-diagnostics
Area: Messages for errors, warnings, and lints
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
HTGAzureX1212
added
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Feb 24, 2024
@rustbot label +E-needs-mcve |
rustbot
added
the
E-needs-mcve
Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
label
Feb 24, 2024
compiler-errors
changed the title
Compiler Suggests Cloning an
Compiler Suggests Cloning an Feb 24, 2024
async
Closureasync
Block
MCVE async fn clone_async_block(value: String) {
for _ in 0..10 {
drop(async { drop(value) })
}
} or async fn clone_async_block(value: String) {
for _ in 0..10 {
async { drop(value) }.await
}
} |
jieyouxu
added
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
and removed
E-needs-mcve
Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
labels
Feb 28, 2024
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 27, 2024
Rollup merge of rust-lang#122589 - wutchzone:121547, r=compiler-errors Fix diagnostics for async block cloning Closes rust-lang#121547 r? diagnostics
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
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
// https://github.com/HTGAzureX1212/HarTex/blob/491fe72da9042d5a5c7f61d0d5cdaf6e9b112057/discord-frontend/hartex-discord-leader/src/kafka.rs#L79-L120
Current output
Desired output
Rationale and extra context
I expect that the
.clone()
invocation to be added for the value that is moved, but for some reason it is doing it for the entireasync
closure.Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: