Skip to content

Commit b417701

Browse files
nikomatsakisEPashkin
authored andcommitted
add an explanatory comment
1 parent bd6c81a commit b417701

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libsyntax/parse/parser.rs

+5
Original file line numberDiff line numberDiff line change
@@ -6151,6 +6151,11 @@ impl<'a> Parser<'a> {
61516151
pub fn submod_path_from_attr(attrs: &[Attribute], dir_path: &Path) -> Option<PathBuf> {
61526152
if let Some(s) = attr::first_attr_value_str_by_name(attrs, "path") {
61536153
let s = s.as_str();
6154+
6155+
// On windows, the base path might have the form
6156+
// `\\?\foo\bar` in which case it does not tolerate
6157+
// mixed `/` and `\` separators, so canonicalize
6158+
// `/` to `\`.
61546159
#[cfg(windows)]
61556160
let s = s.replace("/", "\\");
61566161
Some(dir_path.join(s))

0 commit comments

Comments
 (0)