@@ -106,6 +106,7 @@ use backtrace_rs as backtrace;
106
106
/// previous point in time. In some instances the `Backtrace` type may
107
107
/// internally be empty due to configuration. For more information see
108
108
/// `Backtrace::capture`.
109
+ #[ derive( Debug ) ]
109
110
pub struct Backtrace {
110
111
inner : Inner ,
111
112
}
@@ -126,12 +127,14 @@ pub enum BacktraceStatus {
126
127
Captured ,
127
128
}
128
129
130
+ #[ derive( Debug ) ]
129
131
enum Inner {
130
132
Unsupported ,
131
133
Disabled ,
132
134
Captured ( Mutex < Capture > ) ,
133
135
}
134
136
137
+ #[ derive( Debug ) ]
135
138
struct Capture {
136
139
actual_start : usize ,
137
140
resolved : bool ,
@@ -143,11 +146,13 @@ fn _assert_send_sync() {
143
146
_assert :: < Backtrace > ( ) ;
144
147
}
145
148
149
+ #[ derive( Debug ) ]
146
150
struct BacktraceFrame {
147
151
frame : backtrace:: Frame ,
148
152
symbols : Vec < BacktraceSymbol > ,
149
153
}
150
154
155
+ #[ derive( Debug ) ]
151
156
struct BacktraceSymbol {
152
157
name : Option < Vec < u8 > > ,
153
158
filename : Option < BytesOrWide > ,
@@ -159,6 +164,20 @@ enum BytesOrWide {
159
164
Wide ( Vec < u16 > ) ,
160
165
}
161
166
167
+ impl fmt:: Debug for BytesOrWide {
168
+ fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
169
+ output_filename (
170
+ fmt,
171
+ match self {
172
+ BytesOrWide :: Bytes ( w) => BytesOrWideString :: Bytes ( w) ,
173
+ BytesOrWide :: Wide ( w) => BytesOrWideString :: Wide ( w) ,
174
+ } ,
175
+ backtrace:: PrintFmt :: Full ,
176
+ crate :: env:: current_dir ( ) . as_ref ( ) . ok ( ) ,
177
+ )
178
+ }
179
+ }
180
+
162
181
impl Backtrace {
163
182
/// Returns whether backtrace captures are enabled through environment
164
183
/// variables.
@@ -267,12 +286,6 @@ impl Backtrace {
267
286
}
268
287
269
288
impl fmt:: Display for Backtrace {
270
- fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
271
- fmt:: Debug :: fmt ( self , fmt)
272
- }
273
- }
274
-
275
- impl fmt:: Debug for Backtrace {
276
289
fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
277
290
let mut capture = match & self . inner {
278
291
Inner :: Unsupported => return fmt. write_str ( "unsupported backtrace" ) ,
0 commit comments