@@ -202,7 +202,44 @@ impl VirtAddr {
202
202
203
203
impl fmt:: Debug for VirtAddr {
204
204
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
205
- write ! ( f, "VirtAddr({:#x})" , self . 0 )
205
+ f. debug_tuple ( "VirtAddr" )
206
+ . field ( & format_args ! ( "{:#x}" , self . 0 ) )
207
+ . finish ( )
208
+ }
209
+ }
210
+
211
+ impl fmt:: Binary for VirtAddr {
212
+ #[ inline]
213
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
214
+ fmt:: Binary :: fmt ( & self . 0 , f)
215
+ }
216
+ }
217
+
218
+ impl fmt:: LowerHex for VirtAddr {
219
+ #[ inline]
220
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
221
+ fmt:: LowerHex :: fmt ( & self . 0 , f)
222
+ }
223
+ }
224
+
225
+ impl fmt:: Octal for VirtAddr {
226
+ #[ inline]
227
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
228
+ fmt:: Octal :: fmt ( & self . 0 , f)
229
+ }
230
+ }
231
+
232
+ impl fmt:: UpperHex for VirtAddr {
233
+ #[ inline]
234
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
235
+ fmt:: UpperHex :: fmt ( & self . 0 , f)
236
+ }
237
+ }
238
+
239
+ impl fmt:: Pointer for VirtAddr {
240
+ #[ inline]
241
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
242
+ fmt:: Pointer :: fmt ( & ( self . 0 as * const ( ) ) , f)
206
243
}
207
244
}
208
245
@@ -379,35 +416,44 @@ impl PhysAddr {
379
416
380
417
impl fmt:: Debug for PhysAddr {
381
418
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
382
- write ! ( f, "PhysAddr({:#x})" , self . 0 )
419
+ f. debug_tuple ( "PhysAddr" )
420
+ . field ( & format_args ! ( "{:#x}" , self . 0 ) )
421
+ . finish ( )
383
422
}
384
423
}
385
424
386
425
impl fmt:: Binary for PhysAddr {
387
426
#[ inline]
388
427
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
389
- self . 0 . fmt ( f)
428
+ fmt :: Binary :: fmt ( & self . 0 , f)
390
429
}
391
430
}
392
431
393
432
impl fmt:: LowerHex for PhysAddr {
394
433
#[ inline]
395
434
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
396
- self . 0 . fmt ( f)
435
+ fmt :: LowerHex :: fmt ( & self . 0 , f)
397
436
}
398
437
}
399
438
400
439
impl fmt:: Octal for PhysAddr {
401
440
#[ inline]
402
441
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
403
- self . 0 . fmt ( f)
442
+ fmt :: Octal :: fmt ( & self . 0 , f)
404
443
}
405
444
}
406
445
407
446
impl fmt:: UpperHex for PhysAddr {
408
447
#[ inline]
409
448
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
410
- self . 0 . fmt ( f)
449
+ fmt:: UpperHex :: fmt ( & self . 0 , f)
450
+ }
451
+ }
452
+
453
+ impl fmt:: Pointer for PhysAddr {
454
+ #[ inline]
455
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
456
+ fmt:: Pointer :: fmt ( & ( self . 0 as * const ( ) ) , f)
411
457
}
412
458
}
413
459
0 commit comments