diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/let_underscore_future.rs')
-rw-r--r-- | src/tools/clippy/tests/ui/let_underscore_future.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/let_underscore_future.rs b/src/tools/clippy/tests/ui/let_underscore_future.rs new file mode 100644 index 000000000..d8f54cdca --- /dev/null +++ b/src/tools/clippy/tests/ui/let_underscore_future.rs @@ -0,0 +1,20 @@ +use std::future::Future; + +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(); + let _ = custom(); + + let mut future = some_async_fn(); + do_something_to_future(&mut future); + let _ = future; +} |