error: expected one of `(`, `const`, `default`, `extern`, `fn`, `type`, or `unsafe`, found `}` --> $DIR/issue-41155.rs:13:1 | LL | pub | - expected one of 7 possible tokens here LL | } //~ ERROR expected one of | ^ unexpected token error[E0412]: cannot find type `S` in this scope --> $DIR/issue-41155.rs:11:6 | LL | impl S { //~ ERROR cannot find type | ^ not found in this scope error[E0601]: main function not found error: aborting due to 3 previous errors You've got a few errors: E0412, E0601 If you want more information on an error, try using "rustc --explain E0412"