File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,6 @@ impl<'gctx> Workspace<'gctx> {
215215 /// before returning it, so `Ok` is only returned for valid workspaces.
216216 pub fn new ( manifest_path : & Path , gctx : & ' gctx GlobalContext ) -> CargoResult < Workspace < ' gctx > > {
217217 let mut ws = Workspace :: new_default ( manifest_path. to_path_buf ( ) , gctx) ;
218- ws. target_dir = gctx. target_dir ( ) ?;
219218
220219 if manifest_path. is_relative ( ) {
221220 bail ! (
@@ -226,6 +225,7 @@ impl<'gctx> Workspace<'gctx> {
226225 ws. root_manifest = ws. find_root ( manifest_path) ?;
227226 }
228227
228+ ws. target_dir = gctx. target_dir ( ) ?;
229229 ws. build_dir = gctx. build_dir (
230230 ws. root_manifest
231231 . as_ref ( )
Original file line number Diff line number Diff line change @@ -159,7 +159,10 @@ fn invalid_global_config() {
159159 p. cargo ( "check -v" )
160160 . with_status ( 101 )
161161 . with_stderr_data ( str![ [ r#"
162- [ERROR] could not load Cargo configuration
162+ [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
163+
164+ Caused by:
165+ could not load Cargo configuration
163166
164167Caused by:
165168 could not parse TOML configuration in `[ROOT]/foo/.cargo/config.toml`
Original file line number Diff line number Diff line change @@ -1649,7 +1649,19 @@ target-dir = ''
16491649
16501650#[ cargo_test]
16511651fn cargo_target_empty_env ( ) {
1652- let project = project ( ) . build ( ) ;
1652+ let project = project ( )
1653+ . file (
1654+ "Cargo.toml" ,
1655+ r#"
1656+ [package]
1657+ name = "foo"
1658+ authors = []
1659+ version = "0.0.0"
1660+ build = "build.rs"
1661+ "# ,
1662+ )
1663+ . file ( "src/lib.rs" , "" )
1664+ . build ( ) ;
16531665
16541666 project. cargo ( "check" )
16551667 . env ( "CARGO_TARGET_DIR" , "" )
You can’t perform that action at this time.
0 commit comments