Fix processing mod with multi-level path on Windows

This commit is contained in:
Evgenii Pashkin 2018-06-01 19:56:33 +03:00
parent 577a5b2703
commit bd6c81aebb

View file

@ -6149,7 +6149,14 @@ impl<'a> Parser<'a> {
}
pub fn submod_path_from_attr(attrs: &[Attribute], dir_path: &Path) -> Option<PathBuf> {
attr::first_attr_value_str_by_name(attrs, "path").map(|d| dir_path.join(&d.as_str()))
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
}
}
/// Returns either a path to a module, or .