diff --git a/Cargo.lock b/Cargo.lock index 374478a34fd5b..de3e209c1561f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4805,7 +4805,6 @@ dependencies = [ "rustc_abi", "rustc_data_structures", "rustc_error_messages", - "rustc_fs_util", "rustc_macros", "rustc_serialize", "rustc_span", diff --git a/compiler/rustc_target/Cargo.toml b/compiler/rustc_target/Cargo.toml index d399bfcda50b5..a205009cccfa3 100644 --- a/compiler/rustc_target/Cargo.toml +++ b/compiler/rustc_target/Cargo.toml @@ -11,7 +11,6 @@ object = { version = "0.37.0", default-features = false, features = ["elf", "mac rustc_abi = { path = "../rustc_abi" } rustc_data_structures = { path = "../rustc_data_structures" } rustc_error_messages = { path = "../rustc_error_messages" } -rustc_fs_util = { path = "../rustc_fs_util" } rustc_macros = { path = "../rustc_macros" } rustc_serialize = { path = "../rustc_serialize" } rustc_span = { path = "../rustc_span" } @@ -22,4 +21,3 @@ serde_json = "1.0.59" serde_path_to_error = "0.1.17" tracing = "0.1" # tidy-alphabetical-end - diff --git a/compiler/rustc_target/src/spec/tuple.rs b/compiler/rustc_target/src/spec/tuple.rs index 2c4a879d79440..81a403839e1c1 100644 --- a/compiler/rustc_target/src/spec/tuple.rs +++ b/compiler/rustc_target/src/spec/tuple.rs @@ -3,7 +3,6 @@ use std::path::{Path, PathBuf}; use std::{fmt, io}; use rustc_error_messages::into_diag_arg_using_display; -use rustc_fs_util::try_canonicalize; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; /// Either a target tuple string or a path to a JSON file. @@ -91,7 +90,8 @@ impl TargetTuple { /// Creates a target tuple from the passed target path. pub fn from_path(path: &Path) -> Result { - let canonicalized_path = try_canonicalize(path)?; + let canonicalized_path = + std::fs::canonicalize(path).or_else(|_| std::path::absolute(path))?; let contents = std::fs::read_to_string(&canonicalized_path).map_err(|err| { io::Error::new( io::ErrorKind::InvalidInput,