parent
2f390c05e5
commit
8b10dbfeaa
22
tests/run-pass/backtrace-std.rs
Normal file
22
tests/run-pass/backtrace-std.rs
Normal file
@ -0,0 +1,22 @@
|
||||
// normalize-stderr-test ".*/(rust|checkout)/library/" -> "RUSTLIB/"
|
||||
// normalize-stderr-test "RUSTLIB/(.*):\d+:\d+ "-> "RUSTLIB/$1:LL:COL "
|
||||
// normalize-stderr-test "::<.*>" -> ""
|
||||
// compile-flags: -Zmiri-disable-isolation
|
||||
|
||||
#![feature(backtrace)]
|
||||
|
||||
use std::backtrace::Backtrace;
|
||||
|
||||
#[inline(never)] fn func_a() -> Backtrace { func_b::<u8>() }
|
||||
#[inline(never)] fn func_b<T>() -> Backtrace { func_c() }
|
||||
|
||||
macro_rules! invoke_func_d {
|
||||
() => { func_d() }
|
||||
}
|
||||
|
||||
#[inline(never)] fn func_c() -> Backtrace { invoke_func_d!() }
|
||||
#[inline(never)] fn func_d() -> Backtrace { Backtrace::capture() }
|
||||
|
||||
fn main() {
|
||||
eprint!("{}", func_a());
|
||||
}
|
28
tests/run-pass/backtrace-std.stderr
Normal file
28
tests/run-pass/backtrace-std.stderr
Normal file
@ -0,0 +1,28 @@
|
||||
0: func_d
|
||||
at $DIR/backtrace-std.rs:18
|
||||
1: func_c
|
||||
at $DIR/backtrace-std.rs:17
|
||||
2: func_b
|
||||
at $DIR/backtrace-std.rs:11
|
||||
3: func_a
|
||||
at $DIR/backtrace-std.rs:10
|
||||
4: main
|
||||
at $DIR/backtrace-std.rs:21
|
||||
5: <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
|
||||
RUSTLIB/core/src/ops/function.rs:227
|
||||
6: std::sys_common::backtrace::__rust_begin_short_backtrace
|
||||
RUSTLIB/std/src/sys_common/backtrace.rs:125
|
||||
7: std::rt::lang_start::{closure#0}
|
||||
RUSTLIB/std/src/rt.rs:66
|
||||
8: std::ops::function::impls::call_once
|
||||
RUSTLIB/core/src/ops/function.rs:259
|
||||
9: std::panicking::r#try::do_call
|
||||
RUSTLIB/std/src/panicking.rs:381
|
||||
10: std::panicking::r#try
|
||||
RUSTLIB/std/src/panicking.rs:345
|
||||
11: std::panic::catch_unwind
|
||||
RUSTLIB/std/src/panic.rs:382
|
||||
12: std::rt::lang_start_internal
|
||||
RUSTLIB/std/src/rt.rs:51
|
||||
13: std::rt::lang_start
|
||||
RUSTLIB/std/src/rt.rs:65
|
Loading…
x
Reference in New Issue
Block a user