From 86bc898a2fa5818eac4b87714b59970023acc60f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 10 Jan 2019 13:06:42 +0300 Subject: explain why we use resume_unwind --- crates/ra_db/src/cancellation.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crates/ra_db') diff --git a/crates/ra_db/src/cancellation.rs b/crates/ra_db/src/cancellation.rs index f7077b992..32a268553 100644 --- a/crates/ra_db/src/cancellation.rs +++ b/crates/ra_db/src/cancellation.rs @@ -29,6 +29,8 @@ impl Canceled { } pub fn throw() -> ! { + // We use resume and not panic here to avoid running the panic + // hook (that is, to avoid collecting and printing backtrace). std::panic::resume_unwind(Box::new(Canceled::new())) } } -- cgit v1.2.3