@@ -646,8 +646,13 @@ pub trait PrettyPrinter<'tcx>:
646
646
ty:: Generator ( did, substs, movability) => {
647
647
p ! ( write( "[" ) ) ;
648
648
match movability {
649
+ <<<<<<< HEAD
649
650
hir:: Movability :: Movable => { }
650
651
hir:: Movability :: Static => p ! ( "static " ) ,
652
+ =======
653
+ hir:: Movability :: Movable => p ! ( "[generator" ) ,
654
+ hir:: Movability :: Static => p ! ( "[static generator" ) ,
655
+ >>>>>>> 4 bc0ae233aa... updated p! macro to accept literals
651
656
}
652
657
653
658
if !self . tcx ( ) . sess . verbose ( ) {
@@ -686,6 +691,7 @@ pub trait PrettyPrinter<'tcx>:
686
691
p ! ( in_binder( & types) ) ;
687
692
}
688
693
ty:: Closure ( did, substs) => {
694
+ <<<<<<< HEAD
689
695
p ! ( write( "[" ) ) ;
690
696
if !self. tcx ( ) . sess. verbose( ) {
691
697
p ! ( write( "closure" ) ) ;
@@ -697,6 +703,33 @@ pub trait PrettyPrinter<'tcx>:
697
703
} else {
698
704
let span = self . tcx ( ) . hir ( ) . span ( hir_id) ;
699
705
p ! ( write( "@{}" , self . tcx( ) . sess. source_map( ) . span_to_string( span) ) ) ;
706
+ =======
707
+ p ! ( "[closure" ) ;
708
+
709
+ // FIXME(eddyb) should use `def_span`.
710
+ if let Some ( did) = did. as_local ( ) {
711
+ let hir_id = self . tcx ( ) . hir ( ) . local_def_id_to_hir_id ( did) ;
712
+ if self . tcx ( ) . sess . opts . debugging_opts . span_free_formats {
713
+ p ! ( "@" , print_def_path( did. to_def_id( ) , substs) ) ;
714
+ } else {
715
+ let span = self . tcx ( ) . hir ( ) . span ( hir_id) ;
716
+ p ! ( write( "@{}" , self . tcx( ) . sess. source_map( ) . span_to_string( span) ) ) ;
717
+ }
718
+
719
+ if substs. as_closure ( ) . is_valid ( ) {
720
+ let upvar_tys = substs. as_closure ( ) . upvar_tys ( ) ;
721
+ let mut sep = " " ;
722
+ for ( & var_id, upvar_ty) in self
723
+ . tcx ( )
724
+ . upvars_mentioned ( did)
725
+ . as_ref ( )
726
+ . iter ( )
727
+ . flat_map ( |v| v. keys ( ) )
728
+ . zip ( upvar_tys)
729
+ {
730
+ p ! ( write( "{}{}:" , sep, self . tcx( ) . hir( ) . name( var_id) ) , print( upvar_ty) ) ;
731
+ sep = ", " ;
732
+ >>>>>>> 4 bc0ae233aa... updated p! macro to accept literals
700
733
}
701
734
} else {
702
735
p ! ( write( "@{}" , self . tcx( ) . def_path_str( did) ) ) ;
@@ -723,7 +756,17 @@ pub trait PrettyPrinter<'tcx>:
723
756
}
724
757
}
725
758
}
759
+ <<<<<<< HEAD
726
760
p ! ( "]" ) ;
761
+ =======
762
+
763
+ if self . tcx ( ) . sess . verbose ( ) && substs. as_closure ( ) . is_valid ( ) {
764
+ p ! ( " closure_kind_ty=" , print( substs. as_closure( ) . kind_ty( ) ) ) ;
765
+ p ! ( " closure_sig_as_fn_ptr_ty=" , print( substs. as_closure( ) . sig_as_fn_ptr_ty( ) ) ) ;
766
+ }
767
+
768
+ p ! ( "]" )
769
+ >>>>>>> 4 bc0ae233aa... updated p! macro to accept literals
727
770
}
728
771
ty:: Array ( ty, sz) => {
729
772
p ! ( "[" , print( ty) , "; " ) ;
0 commit comments