File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ pub enum FlycheckConfig {
58
58
extra_env : FxHashMap < String , String > ,
59
59
invocation_strategy : InvocationStrategy ,
60
60
invocation_location : InvocationLocation ,
61
+ target_dir : Option < PathBuf > ,
61
62
} ,
62
63
}
63
64
@@ -354,10 +355,15 @@ impl FlycheckActor {
354
355
extra_env,
355
356
invocation_strategy,
356
357
invocation_location,
358
+ target_dir,
357
359
} => {
358
360
let mut cmd = Command :: new ( command) ;
359
361
cmd. envs ( extra_env) ;
360
362
363
+ if let Some ( target_dir) = target_dir {
364
+ cmd. env ( "CARGO_TARGET_DIR" , target_dir) ;
365
+ }
366
+
361
367
match invocation_location {
362
368
InvocationLocation :: Workspace => {
363
369
match invocation_strategy {
Original file line number Diff line number Diff line change @@ -1289,6 +1289,7 @@ impl Config {
1289
1289
}
1290
1290
1291
1291
pub fn flycheck ( & self ) -> FlycheckConfig {
1292
+ let target_dir = self . target_dir_from_config ( ) ;
1292
1293
match & self . data . check_overrideCommand {
1293
1294
Some ( args) if !args. is_empty ( ) => {
1294
1295
let mut args = args. clone ( ) ;
@@ -1309,6 +1310,7 @@ impl Config {
1309
1310
}
1310
1311
InvocationLocation :: Workspace => flycheck:: InvocationLocation :: Workspace ,
1311
1312
} ,
1313
+ target_dir,
1312
1314
}
1313
1315
}
1314
1316
Some ( _) | None => FlycheckConfig :: CargoCommand {
@@ -1343,7 +1345,7 @@ impl Config {
1343
1345
extra_args : self . check_extra_args ( ) ,
1344
1346
extra_env : self . check_extra_env ( ) ,
1345
1347
ansi_color_output : self . color_diagnostic_output ( ) ,
1346
- target_dir : self . target_dir_from_config ( ) ,
1348
+ target_dir,
1347
1349
} ,
1348
1350
}
1349
1351
}
You can’t perform that action at this time.
0 commit comments