|
1 | | -error: missing `fn`, `type`, `const`, or `static` for item declaration |
2 | | - --> $DIR/issue-40006.rs:1:13 |
| 1 | +error: expected one of `!` or `::`, found `}` |
| 2 | + --> $DIR/issue-40006.rs:3:1 |
3 | 3 | | |
4 | | -LL | impl dyn A { |
5 | | - | _____________^ |
6 | | -LL | | Y |
7 | | - | |____^ missing `fn`, `type`, `const`, or `static` |
| 4 | +LL | impl dyn A { |
| 5 | + | - while parsing this item list starting here |
| 6 | +LL | Y |
| 7 | + | - expected one of `!` or `::` |
| 8 | +LL | } |
| 9 | + | ^ |
| 10 | + | | |
| 11 | + | unexpected token |
| 12 | + | the item list ends here |
8 | 13 |
|
9 | | -error: missing `fn`, `type`, `const`, or `static` for item declaration |
10 | | - --> $DIR/issue-40006.rs:7:10 |
| 14 | +error: expected one of `!` or `::`, found `(` |
| 15 | + --> $DIR/issue-40006.rs:8:6 |
11 | 16 | | |
12 | | -LL | trait X { |
13 | | - | __________^ |
14 | | -LL | | X() {} |
15 | | - | |____^ missing `fn`, `type`, `const`, or `static` |
| 17 | +LL | trait X { |
| 18 | + | - while parsing this item list starting here |
| 19 | +LL | X() {} |
| 20 | + | ^ expected one of `!` or `::` |
| 21 | +... |
| 22 | +LL | } |
| 23 | + | - the item list ends here |
16 | 24 |
|
17 | | -error: missing `fn`, `type`, `const`, or `static` for item declaration |
18 | | - --> $DIR/issue-40006.rs:15:10 |
| 25 | +error: expected one of `!` or `::`, found `(` |
| 26 | + --> $DIR/issue-40006.rs:16:6 |
19 | 27 | | |
20 | | -LL | trait A { |
21 | | - | __________^ |
22 | | -LL | | X() {} |
23 | | - | |____^ missing `fn`, `type`, `const`, or `static` |
| 28 | +LL | trait A { |
| 29 | + | - while parsing this item list starting here |
| 30 | +LL | X() {} |
| 31 | + | ^ expected one of `!` or `::` |
| 32 | +LL | } |
| 33 | + | - the item list ends here |
24 | 34 |
|
25 | 35 | error: expected `[`, found `#` |
26 | 36 | --> $DIR/issue-40006.rs:19:17 |
27 | 37 | | |
28 | 38 | LL | fn xxx() { ### } |
29 | 39 | | ^ expected `[` |
30 | 40 |
|
31 | | -error: missing `fn`, `type`, `const`, or `static` for item declaration |
32 | | - --> $DIR/issue-40006.rs:21:10 |
| 41 | +error: expected one of `!` or `::`, found `=` |
| 42 | + --> $DIR/issue-40006.rs:22:7 |
33 | 43 | | |
34 | | -LL | trait C { |
35 | | - | __________^ |
36 | | -LL | | L = M; |
37 | | - | |____^ missing `fn`, `type`, `const`, or `static` |
| 44 | +LL | trait C { |
| 45 | + | - while parsing this item list starting here |
| 46 | +LL | L = M; |
| 47 | + | ^ expected one of `!` or `::` |
| 48 | +LL | } |
| 49 | + | - the item list ends here |
38 | 50 |
|
39 | | -error: missing `fn`, `type`, `const`, or `static` for item declaration |
40 | | - --> $DIR/issue-40006.rs:24:10 |
| 51 | +error: expected one of `!` or `::`, found `=` |
| 52 | + --> $DIR/issue-40006.rs:25:7 |
41 | 53 | | |
42 | | -LL | trait D { |
43 | | - | __________^ |
44 | | -LL | | Z = { 2 + 3 }; |
45 | | - | |____^ missing `fn`, `type`, `const`, or `static` |
| 54 | +LL | trait D { |
| 55 | + | - while parsing this item list starting here |
| 56 | +LL | Z = { 2 + 3 }; |
| 57 | + | ^ expected one of `!` or `::` |
| 58 | +LL | } |
| 59 | + | - the item list ends here |
46 | 60 |
|
47 | 61 | error: expected one of `!` or `::`, found `(` |
48 | 62 | --> $DIR/issue-40006.rs:28:9 |
49 | 63 | | |
| 64 | +LL | trait E { |
| 65 | + | - while parsing this item list starting here |
50 | 66 | LL | ::Y (); |
51 | 67 | | ^ expected one of `!` or `::` |
| 68 | +LL | } |
| 69 | + | - the item list ends here |
52 | 70 |
|
53 | | -error: missing `fn`, `type`, `const`, or `static` for item declaration |
| 71 | +error: missing `fn` for method definition |
54 | 72 | --> $DIR/issue-40006.rs:32:8 |
55 | 73 | | |
| 74 | +LL | impl S { |
| 75 | + | - while parsing this item list starting here |
56 | 76 | LL | pub hello_method(&self) { |
57 | | - | ^ missing `fn`, `type`, `const`, or `static` |
| 77 | + | ^ |
| 78 | +... |
| 79 | +LL | } |
| 80 | + | - the item list ends here |
| 81 | + | |
| 82 | +help: add `fn` here to parse `hello_method` as a public method |
| 83 | + | |
| 84 | +LL | pub fn hello_method(&self) { |
| 85 | + | ^^ |
58 | 86 |
|
59 | 87 | error[E0599]: no method named `hello_method` found for struct `S` in the current scope |
60 | 88 | --> $DIR/issue-40006.rs:38:7 |
|
0 commit comments