mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
minor: nicer way to defeat disjoint closure captures
Thanks https://internals.rust-lang.org/t/feature-idea-edition-dependent-names-replacing-standard-library-items/15198/27?u=matklad!
This commit is contained in:
parent
55d4813561
commit
cb3d04c818
1 changed files with 4 additions and 2 deletions
|
@ -33,8 +33,10 @@ impl<'a> RequestDispatcher<'a> {
|
||||||
let global_state = panic::AssertUnwindSafe(&mut *self.global_state);
|
let global_state = panic::AssertUnwindSafe(&mut *self.global_state);
|
||||||
|
|
||||||
let result = panic::catch_unwind(move || {
|
let result = panic::catch_unwind(move || {
|
||||||
let _ = &global_state;
|
// Make sure that the whole AssertUnwindSafe is moved into the
|
||||||
let panic::AssertUnwindSafe(global_state) = global_state;
|
// closure, and not just its field.
|
||||||
|
let panic::AssertUnwindSafe(global_state) = { global_state };
|
||||||
|
|
||||||
let _pctx = stdx::panic_context::enter(format!(
|
let _pctx = stdx::panic_context::enter(format!(
|
||||||
"\nversion: {}\nrequest: {} {:#?}",
|
"\nversion: {}\nrequest: {} {:#?}",
|
||||||
env!("REV"),
|
env!("REV"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue