]> git.lizzy.rs Git - rust.git/blob - tests/ui/no-patterns-in-args.rs
Rollup merge of #107757 - clubby789:setup-settings-json, r=jyn514
[rust.git] / tests / ui / no-patterns-in-args.rs
1 extern "C" {
2     fn f1(mut arg: u8); //~ ERROR patterns aren't allowed in foreign function declarations
3     fn f2(&arg: u8); //~ ERROR patterns aren't allowed in foreign function declarations
4     fn f3(arg @ _: u8); //~ ERROR patterns aren't allowed in foreign function declarations
5     fn g1(arg: u8); // OK
6     fn g2(_: u8); // OK
7 // fn g3(u8); // Not yet
8 }
9
10 type A1 = fn(mut arg: u8); //~ ERROR patterns aren't allowed in function pointer types
11 type A2 = fn(&arg: u8); //~ ERROR patterns aren't allowed in function pointer types
12 type B1 = fn(arg: u8); // OK
13 type B2 = fn(_: u8); // OK
14 type B3 = fn(u8); // OK
15
16 fn main() {}