From 15466e00b05c9167687e75582568c3d699e22e62 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 11 Jul 2020 11:07:17 +0200 Subject: [PATCH] go back to using canonicalize() --- cargo-miri/bin.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cargo-miri/bin.rs b/cargo-miri/bin.rs index 6d4c51256f..33a1124aab 100644 --- a/cargo-miri/bin.rs +++ b/cargo-miri/bin.rs @@ -10,7 +10,7 @@ use std::process::Command; use rustc_version::VersionMeta; -const XARGO_MIN_VERSION: (u32, u32, u32) = (0, 3, 20); +const XARGO_MIN_VERSION: (u32, u32, u32) = (0, 3, 21); const CARGO_MIRI_HELP: &str = r#"Interprets bin crates and tests in Miri @@ -258,8 +258,9 @@ fn setup(subcommand: MiriCommand) { // Determine where the rust sources are located. `XARGO_RUST_SRC` env var trumps everything. let rust_src = match std::env::var_os("XARGO_RUST_SRC") { Some(path) => { - // Make path absolute, but not via `canonicalize` (which does not work very well on Windows). - env::current_dir().unwrap().join(path) + let path = PathBuf::from(path); + // Make path absolute if possible. + path.canonicalize().unwrap_or(path) } None => { // Check for `rust-src` rustup component.