Skip to content

Commit 9e073be

Browse files
committed
chore: undo unwinding changes in crates/rust-analyzer/src/cli/rustc_tests.rs
1 parent 3ace563 commit 9e073be

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

crates/rust-analyzer/src/cli/rustc_tests.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Run all tests in a project, similar to `cargo test`, but using the mir interpreter.
22
3+
use std::convert::identity;
34
use std::thread::Builder;
45
use std::time::{Duration, Instant};
56
use std::{cell::RefCell, fs::read_to_string, panic::AssertUnwindSafe, path::PathBuf};
@@ -159,18 +160,18 @@ impl Tester {
159160
.stack_size(40 * 1024 * 1024)
160161
.spawn_scoped(s, {
161162
let diagnostic_config = &diagnostic_config;
162-
// let main = std::thread::current();
163+
let main = std::thread::current();
163164
let analysis = self.host.analysis();
164165
let root_file = self.root_file;
165166
move || {
166-
// let res = std::panic::catch_unwind(move || {
167-
let res = analysis.full_diagnostics(
168-
diagnostic_config,
169-
ide::AssistResolveStrategy::None,
170-
root_file,
171-
);
172-
// });
173-
// main.unpark();
167+
let res = std::panic::catch_unwind(move || {
168+
analysis.full_diagnostics(
169+
diagnostic_config,
170+
ide::AssistResolveStrategy::None,
171+
root_file,
172+
)
173+
});
174+
main.unpark();
174175
res
175176
}
176177
})
@@ -186,7 +187,7 @@ impl Tester {
186187
// attempt to cancel the worker, won't work for chalk hangs unfortunately
187188
self.host.request_cancellation();
188189
}
189-
worker.join()
190+
worker.join().and_then(identity)
190191
});
191192
let mut actual = FxHashMap::default();
192193
let panicked = match res {

0 commit comments

Comments
 (0)