-
Notifications
You must be signed in to change notification settings - Fork 925
Modules with path don't formated on Windows #1754
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
Comments
@nrc Bug in rust repo, can be fixed in https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/parser.rs#L6018: pub fn submod_path_from_attr(attrs: &[Attribute], dir_path: &Path) -> Option<PathBuf> {
if let Some(s) = attr::first_attr_value_str_by_name(attrs, "path") {
let s = s.as_str();
#[cfg(windows)]
let s = s.replace("/", "\\");
Some(dir_path.join(s))
} else {
None
}
} but actual problem lies somewhere in assert_eq!(Path::new("c:\\windows\\temp").canonicalize().unwrap().as_os_str(), "\\\\?\\C:\\Windows\\Temp");
assert_eq!(Path::new("c:\\windows/temp").canonicalize().unwrap().as_os_str(), "\\\\?\\C:\\Windows\\Temp");
assert_eq!(Path::new("\\\\?\\c:\\windows\\temp").canonicalize().unwrap().as_os_str(), "\\\\?\\C:\\Windows\\Temp");
assert!(Path::new("\\\\?\\c:\\windows/temp").canonicalize().is_err()); |
…ows, r=nikomatsakis Fix processing mod with multi-level path on Windows Fix error in [rustfmt](rust-lang/rustfmt#1754) because libsyntax can not handle `mod` with multilevel path on Windows. Alternative is do almost same in https://github.com/rust-lang/rust/blob/master/src/libstd/sys/windows/fs.rs#L717 to allow work on paths with different separators, Ex. "\\\\?\\c:\\windows/temp"
In rustfmt 0.8.2-nightly (5e59925 2018-07-02) issue fixed |
This crate with build script, that use file from
src
produce this error on Windows + MSys2:
Versions:
EDIT: translated error message from Russian.
The text was updated successfully, but these errors were encountered: