1 error: missing `fn`, `type`, or `const` for impl-item declaration
2 --> $DIR/issue-40006.rs:11:9
4 LL | impl X { //~ ERROR cannot be made into an object
6 LL | | //~^ ERROR missing
8 | |____^ missing `fn`, `type`, or `const`
10 error: missing `fn`, `type`, or `const` for trait-item declaration
11 --> $DIR/issue-40006.rs:18:10
13 LL | trait X { //~ ERROR missing
16 | |____^ missing `fn`, `type`, or `const`
18 error: expected `[`, found `#`
19 --> $DIR/issue-40006.rs:20:17
21 LL | fn xxx() { ### } //~ ERROR missing
24 error: missing `fn`, `type`, or `const` for trait-item declaration
25 --> $DIR/issue-40006.rs:20:21
27 LL | fn xxx() { ### } //~ ERROR missing
28 | _____________________^
29 LL | | //~^ ERROR expected
30 LL | | L = M; //~ ERROR missing
31 | |____^ missing `fn`, `type`, or `const`
33 error: missing `fn`, `type`, or `const` for trait-item declaration
34 --> $DIR/issue-40006.rs:22:11
36 LL | L = M; //~ ERROR missing
38 LL | | Z = { 2 + 3 }; //~ ERROR expected one of
39 | |____^ missing `fn`, `type`, or `const`
41 error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `;`
42 --> $DIR/issue-40006.rs:23:18
44 LL | Z = { 2 + 3 }; //~ ERROR expected one of
45 | ^ expected one of 7 possible tokens here
47 error: expected one of `!` or `::`, found `(`
48 --> $DIR/issue-40006.rs:24:9
50 LL | ::Y (); //~ ERROR expected one of
51 | ^ expected one of `!` or `::` here
53 error: missing `fn`, `type`, or `const` for impl-item declaration
54 --> $DIR/issue-40006.rs:28:8
56 LL | pub hello_method(&self) { //~ ERROR missing
57 | ^ missing `fn`, `type`, or `const`
59 error[E0038]: the trait `X` cannot be made into an object
60 --> $DIR/issue-40006.rs:11:6
62 LL | impl X { //~ ERROR cannot be made into an object
63 | ^ the trait `X` cannot be made into an object
65 = note: method `xxx` has no receiver
67 error: aborting due to 9 previous errors
69 For more information about this error, try `rustc --explain E0038`.