Skip to content

Rustfmt is not able to find files internally #4076

@vss96

Description

@vss96

Hi,
I recently moved from importing using "mod.rs" to using path macro. So currently the directory inside src is [ main.rs, something/ a.rs (instead of mod.rs)]. When I run cargo fmt in the same level as src, this particular error is thrown.
Error writing files: io error: something/a.rs: No such file or directory (os error 2)
Interestingly enough, if I run cargo fmt inside the src directory, it works fine. I'm assuming that it's supposed to run on the same level as the toml file, so this is not an expected behavior?
Also, it works fine if I revert back a.rs to mod.rs.

Rust fmt version - rustfmt 1.4.11-stable (1838235 2019-12-03)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions