-
Notifications
You must be signed in to change notification settings - Fork 889
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
Rustfmt cannot find mod with #[path] on windows #4477
Comments
Could you try with a more recent version? There were a lot of improvements on the module resolution in 1.4.20/1.4.22 if I recall correctly |
fix rustfmt-check fail on windows (rel issue: rust-lang/rustfmt#4477)
@calebcartwright, I'm sorry, versions I previously mentioned is my local. But latest rustfmt on CI, there is |
Same problem on ERRORS:
|
Just now I did a : rustup component add rustfmt --toolchain nightly Says it installed but Windows couldn't find the path. |
Workaround rust-lang/rustfmt#4477 - relative paths in `path` attribute See rust-lang/rustfmt#4477 changelog: None
Rustfmt on windows cannot resolve
module
to file if#[path]
used.Note,
#[path]
should contain windows-unfriendly relative path.To Reproduce
Use
#[path = "./some-relative-path.rs"]
in code.Pointed file should be and valid rust source or empty.
Error:
Check out demo for this issue. Also there is two cases reproduced on GHA:
#[path]
with just filenameExpected behavior
No rustfmt's IO errors.
All modules resolved.
Meta
rustfmt
,cargo-fmt
The text was updated successfully, but these errors were encountered: