diff options
| author | Thomas Jespersen <laumann.thomas@gmail.com> | 2017-03-17 23:11:27 +0100 |
|---|---|---|
| committer | Thomas Jespersen <tj@asseco.dk> | 2017-03-30 13:51:16 +0200 |
| commit | b3763862280946cab09cbedc4ad5626ebd95a5b2 (patch) | |
| tree | a4e09d57e1e409228dbd96ef09d78798f5f6d7f7 /src/libsyntax/parse | |
| parent | fe151194e9a919ab23c2bb356767a5cbfa3811e7 (diff) | |
| download | rust-b3763862280946cab09cbedc4ad5626ebd95a5b2.tar.gz rust-b3763862280946cab09cbedc4ad5626ebd95a5b2.zip | |
Replace hardcoded forward slash with path::MAIN_SEPARATOR
Fixes #40149
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index db2878c6b1e..c2c3e5a6855 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -59,7 +59,7 @@ use util::ThinVec; use std::collections::HashSet; use std::{cmp, mem, slice}; -use std::path::{Path, PathBuf}; +use std::path::{self, Path, PathBuf}; bitflags! { flags Restrictions: u8 { @@ -5146,7 +5146,7 @@ impl<'a> Parser<'a> { pub fn default_submod_path(id: ast::Ident, dir_path: &Path, codemap: &CodeMap) -> ModulePath { let mod_name = id.to_string(); let default_path_str = format!("{}.rs", mod_name); - let secondary_path_str = format!("{}/mod.rs", mod_name); + let secondary_path_str = format!("{}{}mod.rs", mod_name, path::MAIN_SEPARATOR); let default_path = dir_path.join(&default_path_str); let secondary_path = dir_path.join(&secondary_path_str); let default_exists = codemap.file_exists(&default_path); @@ -5224,8 +5224,9 @@ impl<'a> Parser<'a> { }; err.span_note(id_sp, &format!("maybe move this module `{0}` to its own directory \ - via `{0}/mod.rs`", - this_module)); + via `{0}{1}mod.rs`", + this_module, + path::MAIN_SEPARATOR)); if paths.path_exists { err.span_note(id_sp, &format!("... or maybe `use` the module `{}` instead \ |
