@@ -168,11 +168,17 @@ impl fmt::Debug for Backtrace {
168168 } ;
169169 capture. resolve ( ) ;
170170
171+ let frames = if fmt. alternate ( ) {
172+ & capture. frames [ ..]
173+ } else {
174+ & capture. frames [ capture. actual_start ..]
175+ } ;
176+
171177 write ! ( fmt, "Backtrace " ) ?;
172178
173179 let mut dbg = fmt. debug_list ( ) ;
174180
175- for frame in & capture . frames {
181+ for frame in frames {
176182 if frame. frame . ip ( ) . is_null ( ) {
177183 continue ;
178184 }
@@ -215,7 +221,7 @@ impl fmt::Debug for BytesOrWide {
215221 BytesOrWide :: Bytes ( w) => BytesOrWideString :: Bytes ( w) ,
216222 BytesOrWide :: Wide ( w) => BytesOrWideString :: Wide ( w) ,
217223 } ,
218- backtrace:: PrintFmt :: Full ,
224+ if fmt . alternate ( ) { backtrace:: PrintFmt :: Full } else { backtrace :: PrintFmt :: Short } ,
219225 crate :: env:: current_dir ( ) . as_ref ( ) . ok ( ) ,
220226 )
221227 }
@@ -419,6 +425,7 @@ mod tests {
419425 let bt = Backtrace :: force_capture ( ) ;
420426 eprintln ! ( "captured: {:?}" , bt) ;
421427 eprintln ! ( "display print: {}" , bt) ;
428+ eprintln ! ( "display print alt: {:#}" , bt) ;
422429 eprintln ! ( "resolved: {:?}" , bt) ;
423430 eprintln ! ( "resolved alt: {:#?}" , bt) ;
424431 unimplemented ! ( ) ;
0 commit comments