10049: minor: nicer way to defeat disjoint closure captures r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2021-08-26 19:14:09 +00:00 committed by GitHub
commit 8f683e911c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,8 +33,10 @@ impl<'a> RequestDispatcher<'a> {
let global_state = panic::AssertUnwindSafe(&mut *self.global_state);
let result = panic::catch_unwind(move || {
let _ = &global_state;
let panic::AssertUnwindSafe(global_state) = global_state;
// Make sure that the whole AssertUnwindSafe is moved into the
// closure, and not just its field.
let panic::AssertUnwindSafe(global_state) = { global_state };
let _pctx = stdx::panic_context::enter(format!(
"\nversion: {}\nrequest: {} {:#?}",
env!("REV"),