We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
__rust_begin_short_backtrace
1 parent 1e99138 commit cd53efcCopy full SHA for cd53efc
library/std/src/sys_common/backtrace.rs
@@ -126,7 +126,12 @@ where
126
F: Send,
127
T: Send,
128
{
129
- f()
+ let result = f();
130
+
131
+ // prevent this frame from being tail-call optimised away
132
+ crate::hint::black_box(());
133
134
+ result
135
}
136
137
pub enum RustBacktrace {
library/test/src/lib.rs
@@ -514,7 +514,10 @@ pub fn run_test(
514
/// Fixed frame used to clean the backtrace with `RUST_BACKTRACE=1`.
515
#[inline(never)]
516
fn __rust_begin_short_backtrace<F: FnOnce()>(f: F) {
517
+ f();
518
519
520
+ black_box(());
521
522
523
fn run_test_in_process(
0 commit comments