-
Notifications
You must be signed in to change notification settings - Fork 898
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: io error: Failed to find module #3901
Comments
I've also hit this issue. It seems like rustfmt does not like path-renamed modules. |
Path attributes with relative paths were previously not treated as relative to the containing file but as relative to the current working directory of rustfmt. The SubModKind enum had a dedicated variant for inner modules with paths. However, the ordinary variant for inner modules also handles the presence of path attributes and treats them correctly. Therefore the fix is to simply remove the dedicated enum variant. Fixes rust-lang#3901 Fixes rust-lang#4076
Path attributes with relative paths were previously not treated as relative to the containing file but as relative to the current working directory of rustfmt. The SubModKind enum had a dedicated variant for inner modules with paths. However, the ordinary variant for inner modules also handles the presence of path attributes and treats them correctly. Therefore the fix is to simply remove the dedicated enum variant. Fixes rust-lang#3901 Fixes rust-lang#4076
Hi, I think I'm still experiencing this issue. I'm new to Rust... I am using relative paths to access different modules. My project compiles fine but "cargo fmt" does not work for me. I'm using Windows 7 and have switched to a nightly build of rustup: Previously when I ran the command "cargo fmt" I would get the error that is the subject of this thread. I now when I run it I get the following error: This does tell me more clearly the path that could not be found but the file is definately in the directory: EDIT: I should say my directory structure is: |
I have two source files:
src/lib.rs
src/b.rs
// (empty file)
cargo check
seems to be fine with this layout, and the code compiles. Butcargo fmt
fails with:Error writing files: io error: Failed to find module b in "." None
The text was updated successfully, but these errors were encountered: