@@ -26,6 +26,8 @@ use std::num::ToPrimitive;
26
26
use std:: ops:: { Add , Sub } ;
27
27
use std:: rc:: Rc ;
28
28
29
+ use std:: fmt;
30
+
29
31
use libc:: c_uint;
30
32
use serialize:: { Encodable , Decodable , Encoder , Decoder } ;
31
33
@@ -199,6 +201,7 @@ pub fn original_sp(cm: &CodeMap, sp: Span, enclosing_sp: Span) -> Span {
199
201
//
200
202
201
203
/// A source code location used for error reporting
204
+ #[ derive( Debug ) ]
202
205
pub struct Loc {
203
206
/// Information about the original source
204
207
pub file : Rc < FileMap > ,
@@ -211,6 +214,7 @@ pub struct Loc {
211
214
/// A source code location used as the result of lookup_char_pos_adj
212
215
// Actually, *none* of the clients use the filename *or* file field;
213
216
// perhaps they should just be removed.
217
+ #[ derive( Debug ) ]
214
218
pub struct LocWithOpt {
215
219
pub filename : FileName ,
216
220
pub line : usize ,
@@ -219,7 +223,9 @@ pub struct LocWithOpt {
219
223
}
220
224
221
225
// used to be structural records. Better names, anyone?
226
+ #[ derive( Debug ) ]
222
227
pub struct FileMapAndLine { pub fm : Rc < FileMap > , pub line : usize }
228
+ #[ derive( Debug ) ]
223
229
pub struct FileMapAndBytePos { pub fm : Rc < FileMap > , pub pos : BytePos }
224
230
225
231
@@ -449,6 +455,12 @@ impl Decodable for FileMap {
449
455
}
450
456
}
451
457
458
+ impl fmt:: Debug for FileMap {
459
+ fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
460
+ write ! ( fmt, "FileMap({})" , self . name)
461
+ }
462
+ }
463
+
452
464
impl FileMap {
453
465
/// EFFECT: register a start-of-line offset in the
454
466
/// table of line-beginnings.
0 commit comments