5
5
//@ ignore-windows
6
6
//@ run-pass
7
7
//@ compile-flags: -Cdebuginfo=line-tables-only
8
+ //@ needs-unwind
8
9
#![ feature( backtrace_frames) ]
9
10
10
11
use std:: backtrace:: { self , Backtrace } ;
@@ -32,7 +33,6 @@ fn assert_contains(
32
33
// FIXME(jieyouxu): fix this ugly fragile test when `BacktraceFrame` has accessors like...
33
34
// `symbols()`.
34
35
let backtrace = format ! ( "{:#?}" , backtrace) ;
35
- eprintln ! ( "{}" , backtrace) ;
36
36
assert ! ( backtrace. contains( expected_name) , "backtrace does not contain expected name {}" , expected_name) ;
37
37
assert ! ( backtrace. contains( expected_file) , "backtrace does not contain expected file {}" , expected_file) ;
38
38
assert ! ( backtrace. contains( & expected_line. to_string( ) ) , "backtrace does not contain expected line {}" , expected_line) ;
@@ -50,6 +50,7 @@ fn main() {
50
50
let mut backtrace: Option < Backtrace > = None ;
51
51
unsafe { line_tables_only_foo ( store_backtrace, addr_of_mut ! ( backtrace) . cast :: < c_void > ( ) ) } ;
52
52
let backtrace = backtrace. expect ( "backtrace" ) ;
53
+ eprintln ! ( "{:#?}" , backtrace) ;
53
54
assert_contains ( & backtrace, "line_tables_only_foo" , "rust_test_helpers.c" , 435 ) ;
54
55
assert_contains ( & backtrace, "line_tables_only_bar" , "rust_test_helpers.c" , 439 ) ;
55
56
assert_contains ( & backtrace, "line_tables_only_baz" , "rust_test_helpers.c" , 443 ) ;
0 commit comments