diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2015-05-14 01:44:57 +0300 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2015-05-14 01:47:56 +0300 |
| commit | 07d4f777905a1faedaf965dac4dc37489bc625c0 (patch) | |
| tree | f398dea94809078c78eabc4c3142ff355e3d729b /src/libsyntax/parse/parser.rs | |
| parent | 0d50b043f748bf9a07b28a8f734327258204e26b (diff) | |
| download | rust-07d4f777905a1faedaf965dac4dc37489bc625c0.tar.gz rust-07d4f777905a1faedaf965dac4dc37489bc625c0.zip | |
syntax: abstract over the file loading mechanism.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index d890708d123..c9d06423a10 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -79,7 +79,6 @@ use parse::PResult; use diagnostic::FatalError; use std::collections::HashSet; -use std::fs; use std::io::prelude::*; use std::mem; use std::path::{Path, PathBuf}; @@ -4851,8 +4850,8 @@ impl<'a> Parser<'a> { let secondary_path_str = format!("{}/mod.rs", mod_name); let default_path = dir_path.join(&default_path_str[..]); let secondary_path = dir_path.join(&secondary_path_str[..]); - let default_exists = fs::metadata(&default_path).is_ok(); - let secondary_exists = fs::metadata(&secondary_path).is_ok(); + let default_exists = self.sess.codemap().file_exists(&default_path); + let secondary_exists = self.sess.codemap().file_exists(&secondary_path); if !self.owns_directory { self.span_err(id_sp, |
