Add try_canonicalize
to rustc_fs_util
and use it over fs::canonicalize
This commit is contained in:
parent
7ac4b82ddd
commit
4f7cd3d459
11 changed files with 31 additions and 14 deletions
|
@ -1,5 +1,6 @@
|
|||
use crate::session::Session;
|
||||
use rustc_data_structures::profiling::VerboseTimingGuard;
|
||||
use rustc_fs_util::try_canonicalize;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
impl Session {
|
||||
|
@ -91,7 +92,7 @@ pub struct CanonicalizedPath {
|
|||
|
||||
impl CanonicalizedPath {
|
||||
pub fn new(path: &Path) -> Self {
|
||||
Self { original: path.to_owned(), canonicalized: std::fs::canonicalize(path).ok() }
|
||||
Self { original: path.to_owned(), canonicalized: try_canonicalize(path).ok() }
|
||||
}
|
||||
|
||||
pub fn canonicalized(&self) -> &PathBuf {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue