Skip to content

Commit 1ddbf1e

Browse files
committed
chore: undo unwinding changes in crates/rust-analyzer/src/cli/rustc_tests.rs
1 parent db4d4c0 commit 1ddbf1e

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};
@@ -155,18 +156,18 @@ impl Tester {
155156
.stack_size(40 * 1024 * 1024)
156157
.spawn_scoped(s, {
157158
let diagnostic_config = &diagnostic_config;
158-
// let main = std::thread::current();
159+
let main = std::thread::current();
159160
let analysis = self.host.analysis();
160161
let root_file = self.root_file;
161162
move || {
162-
// let res = std::panic::catch_unwind(move || {
163-
let res = analysis.full_diagnostics(
164-
diagnostic_config,
165-
ide::AssistResolveStrategy::None,
166-
root_file,
167-
);
168-
// });
169-
// main.unpark();
163+
let res = std::panic::catch_unwind(move || {
164+
analysis.full_diagnostics(
165+
diagnostic_config,
166+
ide::AssistResolveStrategy::None,
167+
root_file,
168+
)
169+
});
170+
main.unpark();
170171
res
171172
}
172173
})
@@ -182,7 +183,7 @@ impl Tester {
182183
// attempt to cancel the worker, won't work for chalk hangs unfortunately
183184
self.host.request_cancellation();
184185
}
185-
worker.join()
186+
worker.join().and_then(identity)
186187
});
187188
let mut actual = FxHashMap::default();
188189
let panicked = match res {

0 commit comments

Comments
 (0)