]> git.lizzy.rs Git - rust.git/blob - tests/run-pass/backtrace-std.rs
Test std::backtrace::Backtrace
[rust.git] / tests / run-pass / backtrace-std.rs
1 // normalize-stderr-test ".*/(rust|checkout)/library/" -> "RUSTLIB/"
2 // normalize-stderr-test "RUSTLIB/(.*):\d+:\d+ "-> "RUSTLIB/$1:LL:COL "
3 // normalize-stderr-test "::<.*>" -> ""
4 // compile-flags: -Zmiri-disable-isolation
5
6 #![feature(backtrace)]
7
8 use std::backtrace::Backtrace;
9
10 #[inline(never)] fn func_a() -> Backtrace { func_b::<u8>() }
11 #[inline(never)] fn func_b<T>() -> Backtrace { func_c() }
12
13 macro_rules! invoke_func_d {
14     () => { func_d() }
15 }
16
17 #[inline(never)] fn func_c() -> Backtrace { invoke_func_d!() }
18 #[inline(never)] fn func_d() -> Backtrace { Backtrace::capture() }
19
20 fn main() {
21     eprint!("{}", func_a());
22 }