Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error writing files: failed to resolve mod on missing semicolon #4431

Closed
micouy opened this issue Sep 22, 2020 · 3 comments · Fixed by #4439
Closed

Error writing files: failed to resolve mod on missing semicolon #4431

micouy opened this issue Sep 22, 2020 · 3 comments · Fixed by #4439
Assignees
Labels
a-parser bug Panic, non-idempotency, invalid code, etc.

Comments

@micouy
Copy link

micouy commented Sep 22, 2020

Describe the bug

rustfmt returns

Error writing files: failed to resolve mod `error`: cannot parse <project dir>/src/error.rs

To Reproduce

src/main.rs:

mod error;

fn main() {}

src/error.rs:

pub struct S // missing semicolon

Meta

  • rustfmt version: rustfmt 1.4.21-nightly (01f2eadc 2020-09-04)
  • From where did you install rustfmt?: rustup
  • How do you run rustfmt: cargo fmt
@micouy micouy added the bug Panic, non-idempotency, invalid code, etc. label Sep 22, 2020
@calebcartwright
Copy link
Member

Could you elaborate on what exactly you think the bug is here? The absence of the ^ expected where, {, (, or ; after struct name error details or something else?

pub struct S is invalid syntax, so an unrecoverable error encountered by the rustc parser is expected.

@micouy
Copy link
Author

micouy commented Sep 22, 2020

Oh sorry then. Yeah, I expected a message cargo build returns, I didn't know that's how it's supposed to work.

@calebcartwright
Copy link
Member

calebcartwright commented Sep 22, 2020

No worries, thanks for clarifying. I'll double check our parsing/rustc parser code later on, it's entirely possible we're intercepting an error that we need to emit ourselves, but aren't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-parser bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants