@@ -163,67 +163,65 @@ pub fn parse_pretty(sess: &Session,
163163
164164impl PpSourceMode {
165165 /// Constructs a `PrinterSupport` object and passes it to `f`.
166- fn call_with_pp_support < ' tcx , A , B , F > ( & self ,
166+ fn call_with_pp_support < ' tcx , A , F > ( & self ,
167167 sess : & ' tcx Session ,
168168 hir_map : Option < & hir_map:: Map < ' tcx > > ,
169- payload : B ,
170169 f : F )
171170 -> A
172- where F : FnOnce ( & PrinterSupport , B ) -> A
171+ where F : FnOnce ( & PrinterSupport ) -> A
173172 {
174173 match * self {
175174 PpmNormal | PpmEveryBodyLoops | PpmExpanded => {
176175 let annotation = NoAnn {
177176 sess : sess,
178177 hir_map : hir_map. map ( |m| m. clone ( ) ) ,
179178 } ;
180- f ( & annotation, payload )
179+ f ( & annotation)
181180 }
182181
183182 PpmIdentified | PpmExpandedIdentified => {
184183 let annotation = IdentifiedAnnotation {
185184 sess : sess,
186185 hir_map : hir_map. map ( |m| m. clone ( ) ) ,
187186 } ;
188- f ( & annotation, payload )
187+ f ( & annotation)
189188 }
190189 PpmExpandedHygiene => {
191190 let annotation = HygieneAnnotation {
192191 sess : sess,
193192 } ;
194- f ( & annotation, payload )
193+ f ( & annotation)
195194 }
196195 _ => panic ! ( "Should use call_with_pp_support_hir" ) ,
197196 }
198197 }
199- fn call_with_pp_support_hir < ' tcx , A , B , F > ( & self ,
198+ fn call_with_pp_support_hir < ' tcx , A , F > ( & self ,
200199 sess : & ' tcx Session ,
201200 hir_map : & hir_map:: Map < ' tcx > ,
202201 analysis : & ty:: CrateAnalysis ,
203202 resolutions : & Resolutions ,
204203 arena : & ' tcx DroplessArena ,
205204 arenas : & ' tcx GlobalArenas < ' tcx > ,
206205 id : & str ,
207- payload : B ,
208206 f : F )
209207 -> A
210- where F : FnOnce ( & HirPrinterSupport , B , & hir:: Crate ) -> A
208+ where F : FnOnce ( & HirPrinterSupport , & hir:: Crate ) -> A
211209 {
212210 match * self {
213211 PpmNormal => {
214212 let annotation = NoAnn {
215213 sess : sess,
216214 hir_map : Some ( hir_map. clone ( ) ) ,
217215 } ;
218- f ( & annotation, payload , hir_map. forest . krate ( ) )
216+ f ( & annotation, hir_map. forest . krate ( ) )
219217 }
220218
221219 PpmIdentified => {
222220 let annotation = IdentifiedAnnotation {
223221 sess : sess,
224222 hir_map : Some ( hir_map. clone ( ) ) ,
225223 } ;
226- f ( & annotation, payload , hir_map. forest . krate ( ) )
224+ f ( & annotation, hir_map. forest . krate ( ) )
227225 }
228226 PpmTyped => {
229227 abort_on_err ( driver:: phase_3_run_analysis_passes ( sess,
@@ -240,7 +238,7 @@ impl PpSourceMode {
240238 tables : Cell :: new ( & empty_tables)
241239 } ;
242240 let _ignore = tcx. dep_graph . in_ignore ( ) ;
243- f ( & annotation, payload , hir_map. forest . krate ( ) )
241+ f ( & annotation, hir_map. forest . krate ( ) )
244242 } ) ,
245243 sess)
246244 }
@@ -825,15 +823,15 @@ pub fn print_after_parsing(sess: &Session,
825823 if let PpmSource ( s) = ppm {
826824 // Silently ignores an identified node.
827825 let out: & mut Write = & mut out;
828- s. call_with_pp_support ( sess, None , box out , |annotation, out | {
826+ s. call_with_pp_support ( sess, None , move |annotation| {
829827 debug ! ( "pretty printing source code {:?}" , s) ;
830828 let sess = annotation. sess ( ) ;
831829 pprust:: print_crate ( sess. codemap ( ) ,
832830 & sess. parse_sess ,
833831 krate,
834832 src_name. to_string ( ) ,
835833 & mut rdr,
836- out,
834+ box out,
837835 annotation. pp_ann ( ) ,
838836 false )
839837 } )
@@ -883,15 +881,15 @@ pub fn print_after_hir_lowering<'tcx, 'a: 'tcx>(sess: &'a Session,
883881 ( PpmSource ( s) , _) => {
884882 // Silently ignores an identified node.
885883 let out: & mut Write = & mut out;
886- s. call_with_pp_support ( sess, Some ( hir_map) , box out , |annotation, out | {
884+ s. call_with_pp_support ( sess, Some ( hir_map) , move |annotation| {
887885 debug ! ( "pretty printing source code {:?}" , s) ;
888886 let sess = annotation. sess ( ) ;
889887 pprust:: print_crate ( sess. codemap ( ) ,
890888 & sess. parse_sess ,
891889 krate,
892890 src_name. to_string ( ) ,
893891 & mut rdr,
894- out,
892+ box out,
895893 annotation. pp_ann ( ) ,
896894 true )
897895 } )
@@ -906,16 +904,15 @@ pub fn print_after_hir_lowering<'tcx, 'a: 'tcx>(sess: &'a Session,
906904 arena,
907905 arenas,
908906 crate_name,
909- box out,
910- |annotation, out, krate| {
907+ move |annotation, krate| {
911908 debug ! ( "pretty printing source code {:?}" , s) ;
912909 let sess = annotation. sess ( ) ;
913910 pprust_hir:: print_crate ( sess. codemap ( ) ,
914911 & sess. parse_sess ,
915912 krate,
916913 src_name. to_string ( ) ,
917914 & mut rdr,
918- out,
915+ box out,
919916 annotation. pp_ann ( ) ,
920917 true )
921918 } )
@@ -930,8 +927,7 @@ pub fn print_after_hir_lowering<'tcx, 'a: 'tcx>(sess: &'a Session,
930927 arena,
931928 arenas,
932929 crate_name,
933- ( out, uii) ,
934- |annotation, ( out, uii) , _| {
930+ move |annotation, _| {
935931 debug ! ( "pretty printing source code {:?}" , s) ;
936932 let sess = annotation. sess ( ) ;
937933 let hir_map = annotation. hir_map ( ) . expect ( "--unpretty missing HIR map" ) ;
0 commit comments