@@ -762,33 +762,35 @@ where
762
762
763
763
// Terminator at the bottom.
764
764
extra_data ( PassWhere :: BeforeLocation ( current_location) , w) ?;
765
- let indented_terminator = format ! ( "{0}{0}{1:?};" , INDENT , data. terminator( ) . kind) ;
766
- if options. include_extra_comments {
767
- writeln ! (
765
+ if data. terminator . is_some ( ) {
766
+ let indented_terminator = format ! ( "{0}{0}{1:?};" , INDENT , data. terminator( ) . kind) ;
767
+ if options. include_extra_comments {
768
+ writeln ! (
769
+ w,
770
+ "{:A$} // {}{}" ,
771
+ indented_terminator,
772
+ if tcx. sess. verbose_internals( ) {
773
+ format!( "{current_location:?}: " )
774
+ } else {
775
+ String :: new( )
776
+ } ,
777
+ comment( tcx, data. terminator( ) . source_info) ,
778
+ A = ALIGN ,
779
+ ) ?;
780
+ } else {
781
+ writeln ! ( w, "{indented_terminator}" ) ?;
782
+ }
783
+
784
+ write_extra (
785
+ tcx,
768
786
w,
769
- "{:A$} // {}{}" ,
770
- indented_terminator,
771
- if tcx. sess. verbose_internals( ) {
772
- format!( "{current_location:?}: " )
773
- } else {
774
- String :: new( )
787
+ |visitor| {
788
+ visitor. visit_terminator ( data. terminator ( ) , current_location) ;
775
789
} ,
776
- comment( tcx, data. terminator( ) . source_info) ,
777
- A = ALIGN ,
790
+ options,
778
791
) ?;
779
- } else {
780
- writeln ! ( w, "{indented_terminator}" ) ?;
781
792
}
782
793
783
- write_extra (
784
- tcx,
785
- w,
786
- |visitor| {
787
- visitor. visit_terminator ( data. terminator ( ) , current_location) ;
788
- } ,
789
- options,
790
- ) ?;
791
-
792
794
extra_data ( PassWhere :: AfterLocation ( current_location) , w) ?;
793
795
extra_data ( PassWhere :: AfterTerminator ( block) , w) ?;
794
796
0 commit comments