File tree 1 file changed +20
-2
lines changed
1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,18 @@ pub struct PhysAddr(u64);
40
40
/// a valid sign extension and are not null either. So automatic sign extension would have
41
41
/// overwritten possibly meaningful bits. This likely indicates a bug, for example an invalid
42
42
/// address calculation.
43
- #[ derive( Debug ) ]
43
+ ///
44
+ /// Contains the invalid address.
44
45
pub struct VirtAddrNotValid ( pub u64 ) ;
45
46
47
+ impl core:: fmt:: Debug for VirtAddrNotValid {
48
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
49
+ f. debug_tuple ( "VirtAddrNotValid" )
50
+ . field ( & format_args ! ( "{:#x}" , self . 0 ) )
51
+ . finish ( )
52
+ }
53
+ }
54
+
46
55
impl VirtAddr {
47
56
/// Creates a new canonical virtual address.
48
57
///
@@ -325,9 +334,18 @@ impl Sub<VirtAddr> for VirtAddr {
325
334
/// A passed `u64` was not a valid physical address.
326
335
///
327
336
/// This means that bits 52 to 64 were not all null.
328
- #[ derive( Debug ) ]
337
+ ///
338
+ /// Contains the invalid address.
329
339
pub struct PhysAddrNotValid ( pub u64 ) ;
330
340
341
+ impl core:: fmt:: Debug for PhysAddrNotValid {
342
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
343
+ f. debug_tuple ( "PhysAddrNotValid" )
344
+ . field ( & format_args ! ( "{:#x}" , self . 0 ) )
345
+ . finish ( )
346
+ }
347
+ }
348
+
331
349
impl PhysAddr {
332
350
/// Creates a new physical address.
333
351
///
You can’t perform that action at this time.
0 commit comments