]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/large_moves.rs
Implement a lint that highlights all moves larger than 1000 bytes
[rust.git] / src / test / ui / async-await / large_moves.rs
1 #![deny(large_assignments)]
2 // build-fail
3
4 // edition:2018
5
6 fn main() {
7     let x = async { //~ ERROR large_assignments
8         let y = [0; 9999];
9         dbg!(y);
10         thing(&y).await;
11         dbg!(y);
12     };
13     let z = (x, 42); //~ ERROR large_assignments
14     //~^ ERROR large_assignments
15     let a = z.0; //~ ERROR large_assignments
16     let b = z.1;
17 }
18
19 async fn thing(y: &[u8]) {
20     dbg!(y);
21 }