error: missing `fn`, `type`, or `const` for impl-item declaration --> $DIR/issue-40006.rs:11:9 | LL | impl X { //~ ERROR cannot be made into an object | _________^ LL | | //~^ ERROR missing LL | | Y | |____^ missing `fn`, `type`, or `const` error: missing `fn`, `type`, or `const` for trait-item declaration --> $DIR/issue-40006.rs:18:10 | LL | trait X { //~ ERROR missing | __________^ LL | | X() {} | |____^ missing `fn`, `type`, or `const` error: expected `[`, found `#` --> $DIR/issue-40006.rs:20:17 | LL | fn xxx() { ### } //~ ERROR missing | ^ expected `[` error: missing `fn`, `type`, or `const` for trait-item declaration --> $DIR/issue-40006.rs:20:21 | LL | fn xxx() { ### } //~ ERROR missing | _____________________^ LL | | //~^ ERROR expected LL | | L = M; //~ ERROR missing | |____^ missing `fn`, `type`, or `const` error: missing `fn`, `type`, or `const` for trait-item declaration --> $DIR/issue-40006.rs:22:11 | LL | L = M; //~ ERROR missing | ___________^ LL | | Z = { 2 + 3 }; //~ ERROR expected one of | |____^ missing `fn`, `type`, or `const` error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `;` --> $DIR/issue-40006.rs:23:18 | LL | Z = { 2 + 3 }; //~ ERROR expected one of | ^ expected one of 7 possible tokens here error: expected one of `!` or `::`, found `(` --> $DIR/issue-40006.rs:24:9 | LL | ::Y (); //~ ERROR expected one of | ^ expected one of `!` or `::` here error: missing `fn`, `type`, or `const` for impl-item declaration --> $DIR/issue-40006.rs:28:8 | LL | pub hello_method(&self) { //~ ERROR missing | ^ missing `fn`, `type`, or `const` error[E0038]: the trait `X` cannot be made into an object --> $DIR/issue-40006.rs:11:6 | LL | impl X { //~ ERROR cannot be made into an object | ^ the trait `X` cannot be made into an object | = note: method `xxx` has no receiver error: aborting due to 9 previous errors For more information about this error, try `rustc --explain E0038`.