Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4805,7 +4805,6 @@ dependencies = [
"rustc_abi",
"rustc_data_structures",
"rustc_error_messages",
"rustc_fs_util",
"rustc_macros",
"rustc_serialize",
"rustc_span",
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_target/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -22,4 +21,3 @@ serde_json = "1.0.59"
serde_path_to_error = "0.1.17"
tracing = "0.1"
# tidy-alphabetical-end

4 changes: 2 additions & 2 deletions compiler/rustc_target/src/spec/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -91,7 +90,8 @@ impl TargetTuple {

/// Creates a target tuple from the passed target path.
pub fn from_path(path: &Path) -> Result<Self, io::Error> {
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,
Expand Down
Loading