]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/large_moves.rs
Rollup merge of #107076 - megakorre:106419_add_test_case, r=compiler-errors
[rust.git] / tests / ui / async-await / large_moves.rs
1 #![deny(large_assignments)]
2 #![feature(large_assignments)]
3 #![cfg_attr(attribute, move_size_limit = "1000")]
4 // build-fail
5 // only-x86_64
6 // revisions: attribute option
7 // [option]compile-flags: -Zmove-size-limit=1000
8
9 // edition:2018
10 // compile-flags: -Zmir-opt-level=0
11
12 fn main() {
13     let x = async { //~ ERROR large_assignments
14         let y = [0; 9999];
15         dbg!(y);
16         thing(&y).await;
17         dbg!(y);
18     };
19     let z = (x, 42); //~ ERROR large_assignments
20     //~^ ERROR large_assignments
21     let a = z.0; //~ ERROR large_assignments
22     let b = z.1;
23 }
24
25 async fn thing(y: &[u8]) {
26     dbg!(y);
27 }