File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
use cargo:: core:: resolver:: ResolveError ;
2
- use cargo:: core:: { compiler:: CompileMode , Workspace } ;
2
+ use cargo:: core:: { compiler:: CompileMode , Shell , Workspace } ;
3
3
use cargo:: ops:: { self , CompileOptions } ;
4
4
use cargo:: util:: { config:: Config , errors:: ManifestError } ;
5
5
6
+ use crate :: support:: install:: cargo_home;
6
7
use crate :: support:: project;
8
+ use crate :: support:: registry;
7
9
8
10
/// Tests inclusion of a `ManifestError` pointing to a member manifest
9
11
/// when that manifest fails to deserialize.
@@ -139,7 +141,9 @@ fn member_manifest_version_error() {
139
141
. file ( "bar/src/main.rs" , "fn main() {}" )
140
142
. build ( ) ;
141
143
142
- let config = Config :: default ( ) . unwrap ( ) ;
144
+ // Prevent this test from accessing the network by setting up .cargo/config.
145
+ registry:: init ( ) ;
146
+ let config = Config :: new ( Shell :: new ( ) , cargo_home ( ) , cargo_home ( ) ) ;
143
147
let ws = Workspace :: new ( & p. root ( ) . join ( "Cargo.toml" ) , & config) . unwrap ( ) ;
144
148
let compile_options = CompileOptions :: new ( & config, CompileMode :: Build ) . unwrap ( ) ;
145
149
let member_bar = ws. members ( ) . find ( |m| & * m. name ( ) == "bar" ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments