diff options
Diffstat (limited to 'src/tools/clippy/tests/ui-toml/large_futures/large_futures.rs')
-rw-r--r-- | src/tools/clippy/tests/ui-toml/large_futures/large_futures.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui-toml/large_futures/large_futures.rs b/src/tools/clippy/tests/ui-toml/large_futures/large_futures.rs new file mode 100644 index 000000000..4158df8b5 --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/large_futures/large_futures.rs @@ -0,0 +1,27 @@ +#![warn(clippy::large_futures)] + +fn main() {} + +pub async fn should_warn() { + let x = [0u8; 1024]; + async {}.await; + dbg!(x); +} + +pub async fn should_not_warn() { + let x = [0u8; 1020]; + async {}.await; + dbg!(x); +} + +pub async fn bar() { + should_warn().await; + + async { + let x = [0u8; 1024]; + dbg!(x); + } + .await; + + should_not_warn().await; +} |