From 4f7cd3d4591aefc4edec1039ac49bef94d65deb1 Mon Sep 17 00:00:00 2001 From: John Kåre Alsaker Date: Thu, 16 Mar 2023 21:42:31 +0100 Subject: Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize` --- compiler/rustc_session/src/utils.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_session/src/utils.rs') 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 { -- cgit 1.4.1-3-g733a5