-
Notifications
You must be signed in to change notification settings - Fork 933
Open
Labels
a-modsModule resolution.Module resolution.bugPanic, non-idempotency, invalid code, etc.Panic, non-idempotency, invalid code, etc.os-windowsp-medium
Description
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.
#[path = "../module_foo.rs"]
mod module_foo;
Error:
> cargo fmt -- --check
error: couldn't read \\?\D:\a\rustfmt-issue-4477\rustfmt-issue-4477\src\..\module_foo.rs: The filename, directory name, or volume label syntax is incorrect. (os error 123)
Error writing files: failed to resolve mod `module_foo`: \\?\D:\a\rustfmt-issue-4477\rustfmt-issue-4477\src\..\module_foo.rs does not exist
Check out demo for this issue. Also there is two cases reproduced on GHA:
Expected behavior
No rustfmt's IO errors.
All modules resolved.
Meta
vimmerru
Metadata
Metadata
Assignees
Labels
a-modsModule resolution.Module resolution.bugPanic, non-idempotency, invalid code, etc.Panic, non-idempotency, invalid code, etc.os-windowsp-medium