@@ -11,24 +11,6 @@ diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
11
11
index 8b76080..9e65de2 100644
12
12
--- a/src/libtest/lib.rs
13
13
+++ b/src/libtest/lib.rs
14
- @@ -52,7 +52,7 @@ use std::fmt;
15
- use std::{
16
- env, io,
17
- io::prelude::Write,
18
- - panic::{self, catch_unwind, AssertUnwindSafe, PanicInfo},
19
- + panic::{self, PanicInfo},
20
- process::{self, Command, Termination},
21
- sync::mpsc::{channel, Sender},
22
- sync::{Arc, Mutex},
23
- @@ -1493,7 +1493,7 @@ pub fn run_test(
24
- fn run_test_inner(
25
- desc: TestDesc,
26
- monitor_ch: Sender<CompletedTest>,
27
- - testfn: Box<dyn FnOnce() + Send>,
28
- + testfn: Box<impl FnOnce() + Send + 'static>,
29
- opts: TestRunOpts,
30
- ) {
31
- let concurrency = opts.concurrency;
32
14
@@ -1509,7 +1509,7 @@ pub fn run_test(
33
15
// If the platform is single-threaded we're just going to run
34
16
// the test synchronously, regardless of the concurrency
@@ -38,55 +20,5 @@ index 8b76080..9e65de2 100644
38
20
if concurrency == Concurrent::Yes && supports_threads {
39
21
let cfg = thread::Builder::new().name(name.as_slice().to_owned());
40
22
cfg.spawn(runtest).unwrap();
41
- @@ -1531,17 +1531,8 @@ pub fn run_test(
42
- // Benchmarks aren't expected to panic, so we run them all in-process.
43
- crate::bench::benchmark(desc, monitor_ch, opts.nocapture, benchfn);
44
- }
45
- - DynTestFn(f) => {
46
- - match strategy {
47
- - RunStrategy::InProcess => (),
48
- - _ => panic!("Cannot run dynamic test fn out-of-process"),
49
- - };
50
- - run_test_inner(
51
- - desc,
52
- - monitor_ch,
53
- - Box::new(move || __rust_begin_short_backtrace(f)),
54
- - test_run_opts,
55
- - );
56
- + DynTestFn(_f) => {
57
- + unimplemented!();
58
- }
59
- StaticTestFn(f) => run_test_inner(
60
- desc,
61
- @@ -1604,10 +1592,10 @@ fn get_result_from_exit_code(desc: &TestDesc, code: i32) -> TestResult {
62
- fn run_test_in_process(
63
- desc: TestDesc,
64
- nocapture: bool,
65
- report_time: bool,
66
- - testfn: Box<dyn FnOnce() + Send>,
67
- + testfn: Box<impl FnOnce() + Send + 'static>,
68
- monitor_ch: Sender<CompletedTest>,
69
- time_opts: Option<time::TestTimeOptions>,
70
- ) {
71
- // Buffer for capturing standard I/O
72
- let data = Arc::new(Mutex::new(Vec::new()));
73
- @@ -1623,7 +1611,7 @@ fn run_test_in_process(desc: TestDesc,
74
- };
75
-
76
- let start = report_time.then(Instant::now);
77
- - let result = catch_unwind(AssertUnwindSafe(testfn));
78
- + let result = Ok::<(), Box<dyn std::any::Any + Send>>(testfn());
79
- let exec_time = start.map(|start| {
80
- let duration = start.elapsed();
81
- TestExecTime(duration)
82
- @@ -1688,7 +1676,7 @@ fn spawn_test_subprocess(desc: TestDesc, report_time: bool, monitor_ch: Sender<M
83
- monitor_ch.send(message).unwrap();
84
- }
85
-
86
- - fn run_test_in_spawned_subprocess(desc: TestDesc, testfn: Box<dyn FnOnce() + Send>) -> ! {
87
- + fn run_test_in_spawned_subprocess(desc: TestDesc, testfn: Box<impl FnOnce() + Send + 'static>) -> ! {
88
- let builtin_panic_hook = panic::take_hook();
89
- let record_result = Arc::new(move |panic_info: Option<&'_ PanicInfo<'_>>| {
90
- let test_result = match panic_info {
91
23
- -
92
24
2.20.1
0 commit comments