@@ -118,7 +118,7 @@ use rustc_middle::mir::spanview::{self, SpanViewable};
118118
119119use rustc_data_structures:: fx:: FxHashMap ;
120120use rustc_middle:: mir:: coverage:: * ;
121- use rustc_middle:: mir:: { self , BasicBlock , TerminatorKind } ;
121+ use rustc_middle:: mir:: { self , BasicBlock } ;
122122use rustc_middle:: ty:: TyCtxt ;
123123use rustc_span:: Span ;
124124
@@ -796,36 +796,15 @@ fn bcb_to_string_sections<'tcx>(
796796 }
797797 let non_term_blocks = bcb_data. basic_blocks [ 0 ..len - 1 ]
798798 . iter ( )
799- . map ( |& bb| format ! ( "{:?}: {}" , bb, term_type ( & mir_body[ bb] . terminator( ) . kind) ) )
799+ . map ( |& bb| format ! ( "{:?}: {}" , bb, mir_body[ bb] . terminator( ) . kind. name ( ) ) )
800800 . collect :: < Vec < _ > > ( ) ;
801801 if non_term_blocks. len ( ) > 0 {
802802 sections. push ( non_term_blocks. join ( "\n " ) ) ;
803803 }
804804 sections. push ( format ! (
805805 "{:?}: {}" ,
806806 bcb_data. basic_blocks. last( ) . unwrap( ) ,
807- term_type ( & bcb_data. terminator( mir_body) . kind)
807+ bcb_data. terminator( mir_body) . kind. name ( ) ,
808808 ) ) ;
809809 sections
810810}
811-
812- /// Returns a simple string representation of a `TerminatorKind` variant, independent of any
813- /// values it might hold.
814- pub ( super ) fn term_type ( kind : & TerminatorKind < ' _ > ) -> & ' static str {
815- match kind {
816- TerminatorKind :: Goto { .. } => "Goto" ,
817- TerminatorKind :: SwitchInt { .. } => "SwitchInt" ,
818- TerminatorKind :: Resume => "Resume" ,
819- TerminatorKind :: Terminate => "Terminate" ,
820- TerminatorKind :: Return => "Return" ,
821- TerminatorKind :: Unreachable => "Unreachable" ,
822- TerminatorKind :: Drop { .. } => "Drop" ,
823- TerminatorKind :: Call { .. } => "Call" ,
824- TerminatorKind :: Assert { .. } => "Assert" ,
825- TerminatorKind :: Yield { .. } => "Yield" ,
826- TerminatorKind :: GeneratorDrop => "GeneratorDrop" ,
827- TerminatorKind :: FalseEdge { .. } => "FalseEdge" ,
828- TerminatorKind :: FalseUnwind { .. } => "FalseUnwind" ,
829- TerminatorKind :: InlineAsm { .. } => "InlineAsm" ,
830- }
831- }
0 commit comments