-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Labels
A-edition-2024Area: The 2024 editionArea: The 2024 editionA-pinArea: PinArea: PinC-bugCategory: This is a bug.Category: This is a bug.S-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
Code
I tried this code:
fn main() {
match std::pin::pin!(foo(&mut 0)) {
_f => {}
}
}
async fn foo(_s: &mut usize) {}
I expected to see this happen: Compiles without error
Instead, this happened:
error[E0716]: temporary value dropped while borrowed
--> src/main.rs:2:35
|
2 | match std::pin::pin!(foo(&mut 0)) {
| ------------------------^--
| | ||
| | |temporary value is freed at the end of this statement
| | creates a temporary value which is freed while still in use
| borrow later used here
|
= note: consider using a `let` binding to create a longer lived value
Version it worked on
It most recently worked on: 1.86.0-beta.6 (2025-03-16 8c7969a3ae4a292789a4)
Version with regression
rustc --version --verbose
:
rustc 1.87.0-nightly (227690a25 2025-03-16)
binary: rustc
commit-hash: 227690a258492c84ae9927d18289208d0180e62f
commit-date: 2025-03-16
host: aarch64-apple-darwin
release: 1.87.0-nightly
LLVM version: 20.1.0
Metadata
Metadata
Assignees
Labels
A-edition-2024Area: The 2024 editionArea: The 2024 editionA-pinArea: PinArea: PinC-bugCategory: This is a bug.Category: This is a bug.S-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.