@@ -6,8 +6,9 @@ use std::fmt;
66use serde:: Deserialize ;
77use serde_untagged:: UntaggedEnumVisitor ;
88
9+ use std:: path:: Path ;
10+
911use crate :: CargoResult ;
10- use crate :: GlobalContext ;
1112
1213use super :: StringList ;
1314use super :: Value ;
@@ -219,14 +220,14 @@ impl<'de> Deserialize<'de> for BuildTargetConfigInner {
219220
220221impl BuildTargetConfig {
221222 /// Gets values of `build.target` as a list of strings.
222- pub fn values ( & self , gctx : & GlobalContext ) -> CargoResult < Vec < String > > {
223+ pub fn values ( & self , cwd : & Path ) -> CargoResult < Vec < String > > {
223224 let map = |s : & String | {
224225 if s. ends_with ( ".json" ) {
225226 // Path to a target specification file (in JSON).
226227 // <https://doc.rust-lang.org/rustc/targets/custom.html>
227228 self . inner
228229 . definition
229- . root ( gctx )
230+ . root ( cwd )
230231 . join ( s)
231232 . to_str ( )
232233 . expect ( "must be utf-8 in toml" )
@@ -412,7 +413,7 @@ impl EnvConfigValue {
412413 }
413414 }
414415
415- pub fn resolve < ' a > ( & ' a self , gctx : & GlobalContext ) -> Cow < ' a , OsStr > {
416+ pub fn resolve < ' a > ( & ' a self , cwd : & Path ) -> Cow < ' a , OsStr > {
416417 match self . inner . val {
417418 EnvConfigValueInner :: Simple ( ref s) => Cow :: Borrowed ( OsStr :: new ( s. as_str ( ) ) ) ,
418419 EnvConfigValueInner :: WithOptions {
@@ -421,7 +422,7 @@ impl EnvConfigValue {
421422 ..
422423 } => {
423424 if relative {
424- let p = self . inner . definition . root ( gctx ) . join ( & value) ;
425+ let p = self . inner . definition . root ( cwd ) . join ( & value) ;
425426 Cow :: Owned ( p. into_os_string ( ) )
426427 } else {
427428 Cow :: Borrowed ( OsStr :: new ( value. as_str ( ) ) )
0 commit comments