@@ -69,45 +69,47 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt::
6969 }
7070
7171 let mut hit = false ;
72- backtrace_rs:: resolve_frame_unsynchronized ( frame, |symbol| {
73- hit = true ;
74-
75- // `__rust_end_short_backtrace` means we are done hiding symbols
76- // for now. Print until we see `__rust_begin_short_backtrace`.
77- if print_fmt == PrintFmt :: Short {
78- if let Some ( sym) = symbol. name ( ) . and_then ( |s| s. as_str ( ) ) {
79- if sym. contains ( "__rust_end_short_backtrace" ) {
80- print = true ;
81- return ;
82- }
83- if print && sym. contains ( "__rust_begin_short_backtrace" ) {
84- print = false ;
85- return ;
86- }
87- if !print {
88- omitted_count += 1 ;
72+ if cfg ! ( not( feature = "backtrace-trace-only" ) ) {
73+ backtrace_rs:: resolve_frame_unsynchronized ( frame, |symbol| {
74+ hit = true ;
75+
76+ // `__rust_end_short_backtrace` means we are done hiding symbols
77+ // for now. Print until we see `__rust_begin_short_backtrace`.
78+ if print_fmt == PrintFmt :: Short {
79+ if let Some ( sym) = symbol. name ( ) . and_then ( |s| s. as_str ( ) ) {
80+ if sym. contains ( "__rust_end_short_backtrace" ) {
81+ print = true ;
82+ return ;
83+ }
84+ if print && sym. contains ( "__rust_begin_short_backtrace" ) {
85+ print = false ;
86+ return ;
87+ }
88+ if !print {
89+ omitted_count += 1 ;
90+ }
8991 }
9092 }
91- }
9293
93- if print {
94- if omitted_count > 0 {
95- debug_assert ! ( print_fmt == PrintFmt :: Short ) ;
96- // only print the message between the middle of frames
97- if !first_omit {
98- let _ = writeln ! (
99- bt_fmt. formatter( ) ,
100- " [... omitted {} frame{} ...]" ,
101- omitted_count,
102- if omitted_count > 1 { "s" } else { "" }
103- ) ;
94+ if print {
95+ if omitted_count > 0 {
96+ debug_assert ! ( print_fmt == PrintFmt :: Short ) ;
97+ // only print the message between the middle of frames
98+ if !first_omit {
99+ let _ = writeln ! (
100+ bt_fmt. formatter( ) ,
101+ " [... omitted {} frame{} ...]" ,
102+ omitted_count,
103+ if omitted_count > 1 { "s" } else { "" }
104+ ) ;
105+ }
106+ first_omit = false ;
107+ omitted_count = 0 ;
104108 }
105- first_omit = false ;
106- omitted_count = 0 ;
109+ res = bt_fmt. frame ( ) . symbol ( frame, symbol) ;
107110 }
108- res = bt_fmt. frame ( ) . symbol ( frame, symbol) ;
109- }
110- } ) ;
111+ } ) ;
112+ }
111113 #[ cfg( target_os = "nto" ) ]
112114 if libc:: __my_thread_exit as * mut libc:: c_void == frame. ip ( ) {
113115 if !hit && print {
0 commit comments