@@ -18,7 +18,7 @@ use rustc_front::hir::InlineAsm;
18
18
use syntax:: ast:: Name ;
19
19
use syntax:: codemap:: Span ;
20
20
use std:: borrow:: { Cow , IntoCow } ;
21
- use std:: fmt:: { Debug , Formatter , Error , Write } ;
21
+ use std:: fmt:: { self , Debug , Formatter , Write } ;
22
22
use std:: { iter, u32} ;
23
23
24
24
/// Lowered representation of a single function.
@@ -183,7 +183,7 @@ impl BasicBlock {
183
183
}
184
184
185
185
impl Debug for BasicBlock {
186
- fn fmt ( & self , fmt : & mut Formatter ) -> Result < ( ) , Error > {
186
+ fn fmt ( & self , fmt : & mut Formatter ) -> fmt :: Result {
187
187
write ! ( fmt, "bb{}" , self . 0 )
188
188
}
189
189
}
@@ -317,7 +317,7 @@ impl<'tcx> BasicBlockData<'tcx> {
317
317
}
318
318
319
319
impl < ' tcx > Debug for Terminator < ' tcx > {
320
- fn fmt ( & self , fmt : & mut Formatter ) -> Result < ( ) , Error > {
320
+ fn fmt ( & self , fmt : & mut Formatter ) -> fmt :: Result {
321
321
try!( self . fmt_head ( fmt) ) ;
322
322
let successors = self . successors ( ) ;
323
323
let labels = self . fmt_successor_labels ( ) ;
@@ -347,7 +347,7 @@ impl<'tcx> Terminator<'tcx> {
347
347
/// Write the "head" part of the terminator; that is, its name and the data it uses to pick the
348
348
/// successor basic block, if any. The only information not inlcuded is the list of possible
349
349
/// successors, which may be rendered differently between the text and the graphviz format.
350
- pub fn fmt_head < W : Write > ( & self , fmt : & mut W ) -> Result < ( ) , Error > {
350
+ pub fn fmt_head < W : Write > ( & self , fmt : & mut W ) -> fmt :: Result {
351
351
use self :: Terminator :: * ;
352
352
match * self {
353
353
Goto { .. } => write ! ( fmt, "goto" ) ,
@@ -421,7 +421,7 @@ pub enum DropKind {
421
421
}
422
422
423
423
impl < ' tcx > Debug for Statement < ' tcx > {
424
- fn fmt ( & self , fmt : & mut Formatter ) -> Result < ( ) , Error > {
424
+ fn fmt ( & self , fmt : & mut Formatter ) -> fmt :: Result {
425
425
use self :: StatementKind :: * ;
426
426
match self . kind {
427
427
Assign ( ref lv, ref rv) => write ! ( fmt, "{:?} = {:?}" , lv, rv) ,
@@ -541,7 +541,7 @@ impl<'tcx> Lvalue<'tcx> {
541
541
}
542
542
543
543
impl < ' tcx > Debug for Lvalue < ' tcx > {
544
- fn fmt ( & self , fmt : & mut Formatter ) -> Result < ( ) , Error > {
544
+ fn fmt ( & self , fmt : & mut Formatter ) -> fmt :: Result {
545
545
use self :: Lvalue :: * ;
546
546
547
547
match * self {
@@ -588,7 +588,7 @@ pub enum Operand<'tcx> {
588
588
}
589
589
590
590
impl < ' tcx > Debug for Operand < ' tcx > {
591
- fn fmt ( & self , fmt : & mut Formatter ) -> Result < ( ) , Error > {
591
+ fn fmt ( & self , fmt : & mut Formatter ) -> fmt :: Result {
592
592
use self :: Operand :: * ;
593
593
match * self {
594
594
Constant ( ref a) => write ! ( fmt, "{:?}" , a) ,
@@ -715,7 +715,7 @@ pub enum UnOp {
715
715
}
716
716
717
717
impl < ' tcx > Debug for Rvalue < ' tcx > {
718
- fn fmt ( & self , fmt : & mut Formatter ) -> Result < ( ) , Error > {
718
+ fn fmt ( & self , fmt : & mut Formatter ) -> fmt :: Result {
719
719
use self :: Rvalue :: * ;
720
720
721
721
match * self {
@@ -771,13 +771,13 @@ pub enum Literal<'tcx> {
771
771
}
772
772
773
773
impl < ' tcx > Debug for Constant < ' tcx > {
774
- fn fmt ( & self , fmt : & mut Formatter ) -> Result < ( ) , Error > {
774
+ fn fmt ( & self , fmt : & mut Formatter ) -> fmt :: Result {
775
775
write ! ( fmt, "{:?}" , self . literal)
776
776
}
777
777
}
778
778
779
779
impl < ' tcx > Debug for Literal < ' tcx > {
780
- fn fmt ( & self , fmt : & mut Formatter ) -> Result < ( ) , Error > {
780
+ fn fmt ( & self , fmt : & mut Formatter ) -> fmt :: Result {
781
781
use self :: Literal :: * ;
782
782
match * self {
783
783
Item { def_id, .. } =>
@@ -788,7 +788,7 @@ impl<'tcx> Debug for Literal<'tcx> {
788
788
}
789
789
790
790
/// Write a `ConstVal` in a way closer to the original source code than the `Debug` output.
791
- pub fn fmt_const_val < W : Write > ( fmt : & mut W , const_val : & ConstVal ) -> Result < ( ) , Error > {
791
+ pub fn fmt_const_val < W : Write > ( fmt : & mut W , const_val : & ConstVal ) -> fmt :: Result {
792
792
use middle:: const_eval:: ConstVal :: * ;
793
793
match * const_val {
794
794
Float ( f) => write ! ( fmt, "{:?}" , f) ,
0 commit comments