]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/inverted-parameters.rs
Rollup merge of #92024 - pcwalton:per-codegen-unit-names, r=davidtwco
[rust.git] / src / test / ui / parser / inverted-parameters.rs
1 struct S;
2
3 impl S {
4     fn foo(&self, &str bar) {}
5     //~^ ERROR expected one of `:`, `@`
6     //~| HELP declare the type after the parameter binding
7     //~| SUGGESTION <identifier>: <type>
8 }
9
10 fn baz(S quux, xyzzy: i32) {}
11 //~^ ERROR expected one of `:`, `@`
12 //~| HELP declare the type after the parameter binding
13 //~| SUGGESTION <identifier>: <type>
14
15 fn one(i32 a b) {}
16 //~^ ERROR expected one of `:`, `@`
17
18 fn pattern((i32, i32) (a, b)) {}
19 //~^ ERROR expected one of `:`
20
21 fn fizz(i32) {}
22 //~^ ERROR expected one of `:`, `@`
23 //~| HELP if this is a parameter name, give it a type
24 //~| HELP if this is a `self` type, give it a parameter name
25 //~| HELP if this is a type, explicitly ignore the parameter name
26
27 fn missing_colon(quux S) {}
28 //~^ ERROR expected one of `:`, `@`
29 //~| HELP declare the type after the parameter binding
30 //~| SUGGESTION <identifier>: <type>
31
32 fn main() {}