explain why we use resume_unwind

This commit is contained in:
Aleksey Kladov 2019-01-10 13:06:42 +03:00
parent f72c031eb9
commit 86bc898a2f

View File

@ -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()))
}
}