forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// check-pass | ||
// edition: 2021 | ||
|
||
// regression test for #116242. | ||
use std::future; | ||
|
||
fn main() { | ||
let mut recv = future::ready(()); | ||
let _combined_fut = async { | ||
let _ = || read(&mut recv); | ||
}; | ||
|
||
drop(recv); | ||
} | ||
|
||
fn read<F: future::Future>(_: &mut F) -> F::Output { | ||
todo!() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// check-pass | ||
// edition: 2021 | ||
|
||
// regression test found while working on #117134. | ||
use std::future; | ||
|
||
fn main() { | ||
let mut recv = future::ready(()); | ||
let _combined_fut = async { | ||
let _ = || read(&mut recv); | ||
}; | ||
|
||
let _uwu = (String::new(), _combined_fut); | ||
// Dropping a coroutine as part of a more complex | ||
// types should not add unnecessary liveness | ||
// constraints. | ||
|
||
drop(recv); | ||
} | ||
|
||
fn read<F: future::Future>(_: &mut F) -> F::Output { | ||
todo!() | ||
} |