Merge branch 'main' into dom/deprecate-mem-qe

pull/24376/head
Dom 2020-12-10 18:06:17 +00:00 committed by GitHub
commit d19a56eee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -131,9 +131,14 @@ Examples:
setup_logging(matches.occurrences_of("verbose"));
// Install custom panic handler (note can not use `_` otherwise
// drop will be called immediately).
let _f = SendPanicsToTracing::new();
// Install custom panic handler and forget about it.
//
// This leaks the handler and prevents it from ever being dropped during the
// lifetime of the program - this is actually a good thing, as it prevents
// the panic handler from being removed while unwinding a panic (which in
// turn, causes a panic - see #548)
let f = SendPanicsToTracing::new();
std::mem::forget(f);
let mut tokio_runtime = get_runtime(matches.value_of("num-threads"))?;
tokio_runtime.block_on(dispatch_args(matches));