@@ -30,7 +30,7 @@ use crate::fmt;
30
30
/// Files are compared as strings, not `Path`, which could be unexpected.
31
31
/// See [`Location::file`]'s documentation for more discussion.
32
32
#[ lang = "panic_location" ]
33
- #[ derive( Copy , Clone , Debug , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
33
+ #[ derive( Copy , Clone , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
34
34
#[ stable( feature = "panic_hooks" , since = "1.10.0" ) ]
35
35
pub struct Location < ' a > {
36
36
// Note: this filename will have exactly one nul byte at its end, but otherwise
@@ -43,6 +43,17 @@ pub struct Location<'a> {
43
43
col : u32 ,
44
44
}
45
45
46
+ #[ stable( feature = "panic_hooks" , since = "1.10.0" ) ]
47
+ impl fmt:: Debug for Location < ' _ > {
48
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
49
+ f. debug_struct ( "Location" )
50
+ . field ( "file" , & self . file ( ) )
51
+ . field ( "line" , & self . line )
52
+ . field ( "column" , & self . col )
53
+ . finish ( )
54
+ }
55
+ }
56
+
46
57
impl < ' a > Location < ' a > {
47
58
/// Returns the source location of the caller of this function. If that function's caller is
48
59
/// annotated then its call location will be returned, and so on up the stack to the first call
0 commit comments