@@ -91,7 +91,7 @@ pub fn dump_mir<'tcx, F>(
9191 body : & Body < ' tcx > ,
9292 extra_data : F ,
9393) where
94- F : FnMut ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
94+ F : Fn ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
9595{
9696 dump_mir_with_options (
9797 tcx,
@@ -119,7 +119,7 @@ pub fn dump_mir_with_options<'tcx, F>(
119119 extra_data : F ,
120120 options : PrettyPrintMirOptions ,
121121) where
122- F : FnMut ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
122+ F : Fn ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
123123{
124124 if !dump_enabled ( tcx, pass_name, body. source . def_id ( ) ) {
125125 return ;
@@ -171,11 +171,11 @@ pub fn dump_mir_to_writer<'tcx, F>(
171171 disambiguator : & dyn Display ,
172172 body : & Body < ' tcx > ,
173173 w : & mut dyn io:: Write ,
174- mut extra_data : F ,
174+ extra_data : F ,
175175 options : PrettyPrintMirOptions ,
176176) -> io:: Result < ( ) >
177177where
178- F : FnMut ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
178+ F : Fn ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
179179{
180180 // see notes on #41697 above
181181 let def_path =
@@ -193,7 +193,7 @@ where
193193 writeln ! ( w) ?;
194194 extra_data ( PassWhere :: BeforeCFG , w) ?;
195195 write_user_type_annotations ( tcx, body, w) ?;
196- write_mir_fn ( tcx, body, & mut extra_data, w, options) ?;
196+ write_mir_fn ( tcx, body, & extra_data, w, options) ?;
197197 extra_data ( PassWhere :: AfterCFG , w)
198198}
199199
@@ -343,11 +343,11 @@ pub fn write_mir_pretty<'tcx>(
343343 }
344344
345345 let render_body = |w : & mut dyn io:: Write , body| -> io:: Result < ( ) > {
346- write_mir_fn ( tcx, body, & mut |_, _| Ok ( ( ) ) , w, options) ?;
346+ write_mir_fn ( tcx, body, & |_, _| Ok ( ( ) ) , w, options) ?;
347347
348348 for body in tcx. promoted_mir ( def_id) {
349349 writeln ! ( w) ?;
350- write_mir_fn ( tcx, body, & mut |_, _| Ok ( ( ) ) , w, options) ?;
350+ write_mir_fn ( tcx, body, & |_, _| Ok ( ( ) ) , w, options) ?;
351351 }
352352 Ok ( ( ) )
353353 } ;
@@ -359,7 +359,7 @@ pub fn write_mir_pretty<'tcx>(
359359 writeln ! ( w, "// MIR FOR CTFE" ) ?;
360360 // Do not use `render_body`, as that would render the promoteds again, but these
361361 // are shared between mir_for_ctfe and optimized_mir
362- write_mir_fn ( tcx, tcx. mir_for_ctfe ( def_id) , & mut |_, _| Ok ( ( ) ) , w, options) ?;
362+ write_mir_fn ( tcx, tcx. mir_for_ctfe ( def_id) , & |_, _| Ok ( ( ) ) , w, options) ?;
363363 } else {
364364 let instance_mir = tcx. instance_mir ( ty:: InstanceKind :: Item ( def_id) ) ;
365365 render_body ( w, instance_mir) ?;
@@ -372,12 +372,12 @@ pub fn write_mir_pretty<'tcx>(
372372pub fn write_mir_fn < ' tcx , F > (
373373 tcx : TyCtxt < ' tcx > ,
374374 body : & Body < ' tcx > ,
375- extra_data : & mut F ,
375+ extra_data : & F ,
376376 w : & mut dyn io:: Write ,
377377 options : PrettyPrintMirOptions ,
378378) -> io:: Result < ( ) >
379379where
380- F : FnMut ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
380+ F : Fn ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
381381{
382382 write_mir_intro ( tcx, body, w, options) ?;
383383 for block in body. basic_blocks . indices ( ) {
@@ -710,12 +710,12 @@ fn write_basic_block<'tcx, F>(
710710 tcx : TyCtxt < ' tcx > ,
711711 block : BasicBlock ,
712712 body : & Body < ' tcx > ,
713- extra_data : & mut F ,
713+ extra_data : & F ,
714714 w : & mut dyn io:: Write ,
715715 options : PrettyPrintMirOptions ,
716716) -> io:: Result < ( ) >
717717where
718- F : FnMut ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
718+ F : Fn ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
719719{
720720 let data = & body[ block] ;
721721
@@ -1363,11 +1363,11 @@ fn post_fmt_projection(projection: &[PlaceElem<'_>], fmt: &mut Formatter<'_>) ->
13631363fn write_extra < ' tcx , F > (
13641364 tcx : TyCtxt < ' tcx > ,
13651365 write : & mut dyn io:: Write ,
1366- mut visit_op : F ,
1366+ visit_op : F ,
13671367 options : PrettyPrintMirOptions ,
13681368) -> io:: Result < ( ) >
13691369where
1370- F : FnMut ( & mut ExtraComments < ' tcx > ) ,
1370+ F : Fn ( & mut ExtraComments < ' tcx > ) ,
13711371{
13721372 if options. include_extra_comments {
13731373 let mut extra_comments = ExtraComments { tcx, comments : vec ! [ ] } ;
0 commit comments