Skip to content

Commit 8f683e9

Browse files
bors[bot]matklad
andauthored
Merge #10049
10049: minor: nicer way to defeat disjoint closure captures r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 55d4813 + cb3d04c commit 8f683e9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/rust-analyzer/src/dispatch.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ impl<'a> RequestDispatcher<'a> {
3333
let global_state = panic::AssertUnwindSafe(&mut *self.global_state);
3434

3535
let result = panic::catch_unwind(move || {
36-
let _ = &global_state;
37-
let panic::AssertUnwindSafe(global_state) = global_state;
36+
// Make sure that the whole AssertUnwindSafe is moved into the
37+
// closure, and not just its field.
38+
let panic::AssertUnwindSafe(global_state) = { global_state };
39+
3840
let _pctx = stdx::panic_context::enter(format!(
3941
"\nversion: {}\nrequest: {} {:#?}",
4042
env!("REV"),

0 commit comments

Comments
 (0)