]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/argument-patterns.rs
Rollup merge of #60897 - seanmonstar:patch-4, r=sfackler
[rust.git] / src / test / ui / async-await / argument-patterns.rs
1 // edition:2018
2 // run-pass
3
4 #![allow(unused_variables)]
5 #![deny(unused_mut)]
6 #![feature(async_await)]
7
8 type A = Vec<u32>;
9
10 async fn a(n: u32, mut vec: A) {
11     vec.push(n);
12 }
13
14 async fn b(n: u32, ref mut vec: A) {
15     vec.push(n);
16 }
17
18 async fn c(ref vec: A) {
19     vec.contains(&0);
20 }
21
22 async fn d((a, mut b): (A, A)) {
23     b.push(1);
24 }
25
26 async fn f((ref mut a, ref b): (A, A)) {}
27
28 async fn g(((ref a, ref mut b), (ref mut c, ref d)): ((A, A), (A, A))) {}
29
30 fn main() {}