Prevent __rust_begin_short_backtrace frames from being tail-call optimised away

This commit is contained in:
Alan Egerton
2020-08-04 22:18:20 +01:00
parent 4d4342347b
commit 5792840bf5
6 changed files with 74 additions and 12 deletions

View File

@@ -514,7 +514,10 @@ pub fn run_test(
/// Fixed frame used to clean the backtrace with `RUST_BACKTRACE=1`.
#[inline(never)]
fn __rust_begin_short_backtrace<F: FnOnce()>(f: F) {
f()
f();
// prevent this frame from being tail-call optimised away
black_box(());
}
fn run_test_in_process(