Skip to content

Commit 83b1d7f

Browse files
committed
syntax: Remove #[feature(path_ext)]
Replace Path::exists with stable metadata call.
1 parent c3da1a1 commit 83b1d7f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/libsyntax/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#![feature(rustc_private)]
3232
#![feature(staged_api)]
3333
#![feature(unicode)]
34-
#![feature(path_ext)]
3534
#![feature(str_char)]
3635

3736
extern crate arena;

src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ use parse::PResult;
7878
use diagnostic::FatalError;
7979

8080
use std::collections::HashSet;
81+
use std::fs;
8182
use std::io::prelude::*;
8283
use std::mem;
8384
use std::path::{Path, PathBuf};
@@ -4775,8 +4776,8 @@ impl<'a> Parser<'a> {
47754776
let secondary_path_str = format!("{}/mod.rs", mod_name);
47764777
let default_path = dir_path.join(&default_path_str[..]);
47774778
let secondary_path = dir_path.join(&secondary_path_str[..]);
4778-
let default_exists = default_path.exists();
4779-
let secondary_exists = secondary_path.exists();
4779+
let default_exists = fs::metadata(&default_path).is_ok();
4780+
let secondary_exists = fs::metadata(&secondary_path).is_ok();
47804781

47814782
if !self.owns_directory {
47824783
self.span_err(id_sp,

0 commit comments

Comments
 (0)