diff options
author | Alexander Andreev <[email protected]> | 2019-09-30 10:07:26 +0100 |
---|---|---|
committer | Alexander Andreev <[email protected]> | 2019-09-30 10:07:26 +0100 |
commit | 81efd696ccb369d6c4813bad1107bfd9e270385b (patch) | |
tree | f91b652c3ee8e4503c146bf4f76f129fb9ef1428 /crates/ra_db/src | |
parent | fdbd6bb11a0c47bf9ba1428e6bd432cd2ce72045 (diff) | |
parent | 733f1d8b709788225bd06f8c0aee1819db92620b (diff) |
Merge branch 'master' into feature/issue/1856
# Conflicts:
# crates/ra_assists/src/ast_editor.rs
Diffstat (limited to 'crates/ra_db/src')
-rw-r--r-- | crates/ra_db/src/lib.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index c54791b7a..603daed37 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs | |||
@@ -32,11 +32,10 @@ pub trait CheckCanceled { | |||
32 | 32 | ||
33 | fn catch_canceled<F, T>(&self, f: F) -> Result<T, Canceled> | 33 | fn catch_canceled<F, T>(&self, f: F) -> Result<T, Canceled> |
34 | where | 34 | where |
35 | Self: Sized, | 35 | Self: Sized + panic::RefUnwindSafe, |
36 | F: FnOnce(&Self) -> T + panic::UnwindSafe, | 36 | F: FnOnce(&Self) -> T + panic::UnwindSafe, |
37 | { | 37 | { |
38 | let this = panic::AssertUnwindSafe(self); | 38 | panic::catch_unwind(|| f(self)).map_err(|err| match err.downcast::<Canceled>() { |
39 | panic::catch_unwind(|| f(*this)).map_err(|err| match err.downcast::<Canceled>() { | ||
40 | Ok(canceled) => *canceled, | 39 | Ok(canceled) => *canceled, |
41 | Err(payload) => panic::resume_unwind(payload), | 40 | Err(payload) => panic::resume_unwind(payload), |
42 | }) | 41 | }) |