about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-06-06 16:20:47 -0400
committerEvgenii Pashkin <eapashkin@gmail.com>2018-06-07 00:26:31 +0300
commitb417701ac118d4864e3bd07b700f3c8af724b199 (patch)
tree90ed0fd53597642543b8ed1c57823ac75237c151 /src/libsyntax/parse
parentbd6c81aebbda2cc1dfcfa83047db81b358b01a92 (diff)
downloadrust-b417701ac118d4864e3bd07b700f3c8af724b199.tar.gz
rust-b417701ac118d4864e3bd07b700f3c8af724b199.zip
add an explanatory comment
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 91bf1f6a953..f6692a30491 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -6151,6 +6151,11 @@ impl<'a> Parser<'a> {
     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();
+
+            // On windows, the base path might have the form
+            // `\\?\foo\bar` in which case it does not tolerate
+            // mixed `/` and `\` separators, so canonicalize
+            // `/` to `\`.
             #[cfg(windows)]
             let s = s.replace("/", "\\");
             Some(dir_path.join(s))