fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
1.9 KiB61 linesraw
1error: expected one of `:`, `@`, or `|`, found `bar`
2  --> $DIR/inverted-parameters.rs:4:24
3   |
4LL |     fn foo(&self, &str bar) {}
5   |                   -----^^^
6   |                   |    |
7   |                   |    expected one of `:`, `@`, or `|`
8   |                   help: declare the type after the parameter binding: `<identifier>: <type>`
9
10error: expected one of `:`, `@`, or `|`, found `quux`
11  --> $DIR/inverted-parameters.rs:10:10
12   |
13LL | fn baz(S quux, xyzzy: i32) {}
14   |        --^^^^
15   |        | |
16   |        | expected one of `:`, `@`, or `|`
17   |        help: declare the type after the parameter binding: `<identifier>: <type>`
18
19error: expected one of `:`, `@`, or `|`, found `a`
20  --> $DIR/inverted-parameters.rs:15:12
21   |
22LL | fn one(i32 a b) {}
23   |            ^ expected one of `:`, `@`, or `|`
24
25error: expected one of `:` or `|`, found `(`
26  --> $DIR/inverted-parameters.rs:18:23
27   |
28LL | fn pattern((i32, i32) (a, b)) {}
29   |                       ^ expected one of `:` or `|`
30
31error: expected one of `:`, `@`, or `|`, found `)`
32  --> $DIR/inverted-parameters.rs:21:12
33   |
34LL | fn fizz(i32) {}
35   |            ^ expected one of `:`, `@`, or `|`
36   |
37   = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
38help: if this is a `self` type, give it a parameter name
39   |
40LL | fn fizz(self: i32) {}
41   |         ^^^^^^^^^
42help: if this was a parameter name, give it a type
43   |
44LL | fn fizz(i32: TypeName) {}
45   |         ^^^^^^^^^^^^^
46help: if this is a type, explicitly ignore the parameter name
47   |
48LL | fn fizz(_: i32) {}
49   |         ^^^^^^
50
51error: expected one of `:`, `@`, or `|`, found `S`
52  --> $DIR/inverted-parameters.rs:27:23
53   |
54LL | fn missing_colon(quux S) {}
55   |                  -----^
56   |                  |    |
57   |                  |    expected one of `:`, `@`, or `|`
58   |                  help: declare the type after the parameter binding: `<identifier>: <type>`
59
60error: aborting due to 6 previous errors
61