diff options
| author | Yamakaky <yamakaky@yamaworld.fr> | 2017-03-04 10:27:52 -0500 |
|---|---|---|
| committer | Yamakaky <yamakaky@yamaworld.fr> | 2017-05-09 19:51:50 +0200 |
| commit | ca8b75466cef854d30fdf7614c2358b1eb46816e (patch) | |
| tree | f2bfc45697fca40fadaa04346ed404598a7ad773 /src/libstd/thread | |
| parent | f3fc547194d22dc673274ac20e9a7b1e607cb862 (diff) | |
| download | rust-ca8b75466cef854d30fdf7614c2358b1eb46816e.tar.gz rust-ca8b75466cef854d30fdf7614c2358b1eb46816e.zip | |
Don't show the std frames before user code on unwinding.
When `RUST_BACKTRACE=1`, remove all frames after `__rust_maybe_catch_panic`. Tested on `main`, threads, tests and benches. Cleaning of the top of the stacktrace is let to a future PR. Fixes #40201 See #41815
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 04cd28df445..3101d08244e 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -358,7 +358,9 @@ impl Builder { } unsafe { thread_info::set(imp::guard::current(), their_thread); - let try_result = panic::catch_unwind(panic::AssertUnwindSafe(f)); + let try_result = panic::catch_unwind(panic::AssertUnwindSafe(|| { + ::sys_common::backtrace::__rust_begin_short_backtrace(f) + })); *their_packet.get() = Some(try_result); } }; |
