@@ -470,7 +470,7 @@ impl<'a> TestRunnerInner<'a> {
470
470
471
471
// If creating a job fails, we might be on an old system. Ignore this -- job objects are a
472
472
// best-effort thing.
473
- let job = imp:: Job :: new ( ) . ok ( ) ;
473
+ let job = imp:: Job :: create ( ) . ok ( ) ;
474
474
475
475
if !self . no_capture {
476
476
// Capture stdout and stderr.
@@ -1241,6 +1241,7 @@ pub fn configure_handle_inheritance(
1241
1241
#[ cfg( windows) ]
1242
1242
mod imp {
1243
1243
use super :: * ;
1244
+ pub ( super ) use win32job:: Job ;
1244
1245
use win32job:: JobError ;
1245
1246
use windows:: Win32 :: {
1246
1247
Foundation :: { SetHandleInformation , HANDLE , HANDLE_FLAGS , HANDLE_FLAG_INHERIT } ,
@@ -1286,24 +1287,6 @@ mod imp {
1286
1287
// TODO: set process group on Windows for better ctrl-C handling.
1287
1288
}
1288
1289
1289
- /// Wrapper around a Job that implements Send and Sync.
1290
- #[ derive( Debug ) ]
1291
- pub ( super ) struct Job {
1292
- inner : win32job:: Job ,
1293
- }
1294
-
1295
- impl Job {
1296
- pub ( super ) fn new ( ) -> Result < Self , JobError > {
1297
- Ok ( Self {
1298
- inner : win32job:: Job :: create ( ) ?,
1299
- } )
1300
- }
1301
- }
1302
-
1303
- // https://github.com/ohadravid/win32job-rs/issues/1
1304
- unsafe impl Send for Job { }
1305
- unsafe impl Sync for Job { }
1306
-
1307
1290
pub ( super ) fn assign_process_to_job (
1308
1291
child : & tokio:: process:: Child ,
1309
1292
job : Option < & Job > ,
@@ -1319,7 +1302,7 @@ mod imp {
1319
1302
}
1320
1303
} ;
1321
1304
1322
- job. inner . assign_process ( handle) ?;
1305
+ job. assign_process ( handle) ?;
1323
1306
}
1324
1307
1325
1308
Ok ( ( ) )
@@ -1337,7 +1320,7 @@ mod imp {
1337
1320
return ;
1338
1321
}
1339
1322
if let Some ( job) = job {
1340
- let handle = job. inner . handle ( ) ;
1323
+ let handle = job. handle ( ) ;
1341
1324
unsafe {
1342
1325
// Ignore the error here -- it's likely due to the process exiting.
1343
1326
// Note: 1 is the exit code returned by Windows.
@@ -1394,7 +1377,7 @@ mod imp {
1394
1377
pub ( super ) struct Job ( ( ) ) ;
1395
1378
1396
1379
impl Job {
1397
- pub ( super ) fn new ( ) -> Result < Self , Infallible > {
1380
+ pub ( super ) fn create ( ) -> Result < Self , Infallible > {
1398
1381
Ok ( Self ( ( ) ) )
1399
1382
}
1400
1383
}
0 commit comments