2022-11-21 19:34:47 +00:00
|
|
|
use std::future::Future;
|
2023-08-24 19:32:12 +00:00
|
|
|
//@no-rustfix
|
2022-11-21 19:34:47 +00:00
|
|
|
async fn some_async_fn() {}
|
|
|
|
|
|
|
|
fn sync_side_effects() {}
|
|
|
|
fn custom() -> impl Future<Output = ()> {
|
|
|
|
sync_side_effects();
|
|
|
|
async {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn do_something_to_future(future: &mut impl Future<Output = ()>) {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = some_async_fn();
|
2023-08-24 19:32:12 +00:00
|
|
|
//~^ ERROR: non-binding `let` on a future
|
2022-11-21 19:34:47 +00:00
|
|
|
let _ = custom();
|
2023-08-24 19:32:12 +00:00
|
|
|
//~^ ERROR: non-binding `let` on a future
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
|
|
let mut future = some_async_fn();
|
|
|
|
do_something_to_future(&mut future);
|
|
|
|
let _ = future;
|
2023-08-24 19:32:12 +00:00
|
|
|
//~^ ERROR: non-binding `let` on a future
|
2022-11-21 19:34:47 +00:00
|
|
|
}
|