fork/rust

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

borsAuto merge of #68568 - pietroalbini:stable-next, r=pietroalbini5e1a799842b

1.41.0
1.8 KiB57 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 was a parameter name, give it a type
39   |
40LL | fn fizz(i32: TypeName) {}
41   |         ^^^^^^^^^^^^^
42help: if this is a type, explicitly ignore the parameter name
43   |
44LL | fn fizz(_: i32) {}
45   |         ^^^^^^
46
47error: expected one of `:`, `@`, or `|`, found `S`
48  --> $DIR/inverted-parameters.rs:26:23
49   |
50LL | fn missing_colon(quux S) {}
51   |                  -----^
52   |                  |    |
53   |                  |    expected one of `:`, `@`, or `|`
54   |                  help: declare the type after the parameter binding: `<identifier>: <type>`
55
56error: aborting due to 6 previous errors
57