about summary refs log tree commit diff
path: root/compiler/rustc_session/src/utils.rs
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2023-03-16 21:42:31 +0100
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2023-03-16 21:50:23 +0100
commit4f7cd3d4591aefc4edec1039ac49bef94d65deb1 (patch)
tree744a3b3b42c26c924c69c42ce5e75589a164198b /compiler/rustc_session/src/utils.rs
parent7ac4b82ddd596a218cac8cd6b88a91b54fcdcf13 (diff)
downloadrust-4f7cd3d4591aefc4edec1039ac49bef94d65deb1.tar.gz
rust-4f7cd3d4591aefc4edec1039ac49bef94d65deb1.zip
Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize`
Diffstat (limited to 'compiler/rustc_session/src/utils.rs')
-rw-r--r--compiler/rustc_session/src/utils.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_session/src/utils.rs b/compiler/rustc_session/src/utils.rs
index b996d36a318..47fe9a990d3 100644
--- a/compiler/rustc_session/src/utils.rs
+++ b/compiler/rustc_session/src/utils.rs
@@ -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 {