We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 577a5b2 commit bd6c81aCopy full SHA for bd6c81a
src/libsyntax/parse/parser.rs
@@ -6149,7 +6149,14 @@ impl<'a> Parser<'a> {
6149
}
6150
6151
pub fn submod_path_from_attr(attrs: &[Attribute], dir_path: &Path) -> Option<PathBuf> {
6152
- 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") {
6153
+ let s = s.as_str();
6154
+ #[cfg(windows)]
6155
+ let s = s.replace("/", "\\");
6156
+ Some(dir_path.join(s))
6157
+ } else {
6158
+ None
6159
+ }
6160
6161
6162
/// Returns either a path to a module, or .
0 commit comments