syntax: abstract over the file loading mechanism.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user