diff --git a/src/librustc_target/spec/apple_ios_base.rs b/src/librustc_target/spec/apple_ios_base.rs index 40cc7f42010..d400bc62bfd 100644 --- a/src/librustc_target/spec/apple_ios_base.rs +++ b/src/librustc_target/spec/apple_ios_base.rs @@ -1,5 +1,6 @@ use std::env; use std::io; +use std::path::Path; use std::process::Command; use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions}; @@ -29,7 +30,7 @@ impl Arch { pub fn get_sdk_root(sdk_name: &str) -> Result { if let Some(sdkroot) = env::var("SDKROOT").ok() { - let sdkroot_path = Path::new(sdkroot); + let sdkroot_path = Path::new(&sdkroot); if sdkroot_path.is_absolute() && sdkroot_path != Path::new("/") && sdkroot_path.exists() { return Ok(sdkroot); }