@@ -91,7 +91,7 @@ pub fn dump_mir<'tcx, F>(
91
91
body : & Body < ' tcx > ,
92
92
extra_data : F ,
93
93
) where
94
- F : FnMut ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
94
+ F : Fn ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
95
95
{
96
96
dump_mir_with_options (
97
97
tcx,
@@ -119,7 +119,7 @@ pub fn dump_mir_with_options<'tcx, F>(
119
119
extra_data : F ,
120
120
options : PrettyPrintMirOptions ,
121
121
) where
122
- F : FnMut ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
122
+ F : Fn ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
123
123
{
124
124
if !dump_enabled ( tcx, pass_name, body. source . def_id ( ) ) {
125
125
return ;
@@ -171,11 +171,11 @@ pub fn dump_mir_to_writer<'tcx, F>(
171
171
disambiguator : & dyn Display ,
172
172
body : & Body < ' tcx > ,
173
173
w : & mut dyn io:: Write ,
174
- mut extra_data : F ,
174
+ extra_data : F ,
175
175
options : PrettyPrintMirOptions ,
176
176
) -> io:: Result < ( ) >
177
177
where
178
- F : FnMut ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
178
+ F : Fn ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
179
179
{
180
180
// see notes on #41697 above
181
181
let def_path =
@@ -193,7 +193,7 @@ where
193
193
writeln ! ( w) ?;
194
194
extra_data ( PassWhere :: BeforeCFG , w) ?;
195
195
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) ?;
197
197
extra_data ( PassWhere :: AfterCFG , w)
198
198
}
199
199
@@ -343,11 +343,11 @@ pub fn write_mir_pretty<'tcx>(
343
343
}
344
344
345
345
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) ?;
347
347
348
348
for body in tcx. promoted_mir ( def_id) {
349
349
writeln ! ( w) ?;
350
- write_mir_fn ( tcx, body, & mut |_, _| Ok ( ( ) ) , w, options) ?;
350
+ write_mir_fn ( tcx, body, & |_, _| Ok ( ( ) ) , w, options) ?;
351
351
}
352
352
Ok ( ( ) )
353
353
} ;
@@ -359,7 +359,7 @@ pub fn write_mir_pretty<'tcx>(
359
359
writeln ! ( w, "// MIR FOR CTFE" ) ?;
360
360
// Do not use `render_body`, as that would render the promoteds again, but these
361
361
// 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) ?;
363
363
} else {
364
364
let instance_mir = tcx. instance_mir ( ty:: InstanceKind :: Item ( def_id) ) ;
365
365
render_body ( w, instance_mir) ?;
@@ -372,12 +372,12 @@ pub fn write_mir_pretty<'tcx>(
372
372
pub fn write_mir_fn < ' tcx , F > (
373
373
tcx : TyCtxt < ' tcx > ,
374
374
body : & Body < ' tcx > ,
375
- extra_data : & mut F ,
375
+ extra_data : & F ,
376
376
w : & mut dyn io:: Write ,
377
377
options : PrettyPrintMirOptions ,
378
378
) -> io:: Result < ( ) >
379
379
where
380
- F : FnMut ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
380
+ F : Fn ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
381
381
{
382
382
write_mir_intro ( tcx, body, w, options) ?;
383
383
for block in body. basic_blocks . indices ( ) {
@@ -710,12 +710,12 @@ fn write_basic_block<'tcx, F>(
710
710
tcx : TyCtxt < ' tcx > ,
711
711
block : BasicBlock ,
712
712
body : & Body < ' tcx > ,
713
- extra_data : & mut F ,
713
+ extra_data : & F ,
714
714
w : & mut dyn io:: Write ,
715
715
options : PrettyPrintMirOptions ,
716
716
) -> io:: Result < ( ) >
717
717
where
718
- F : FnMut ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
718
+ F : Fn ( PassWhere , & mut dyn io:: Write ) -> io:: Result < ( ) > ,
719
719
{
720
720
let data = & body[ block] ;
721
721
@@ -1363,11 +1363,11 @@ fn post_fmt_projection(projection: &[PlaceElem<'_>], fmt: &mut Formatter<'_>) ->
1363
1363
fn write_extra < ' tcx , F > (
1364
1364
tcx : TyCtxt < ' tcx > ,
1365
1365
write : & mut dyn io:: Write ,
1366
- mut visit_op : F ,
1366
+ visit_op : F ,
1367
1367
options : PrettyPrintMirOptions ,
1368
1368
) -> io:: Result < ( ) >
1369
1369
where
1370
- F : FnMut ( & mut ExtraComments < ' tcx > ) ,
1370
+ F : Fn ( & mut ExtraComments < ' tcx > ) ,
1371
1371
{
1372
1372
if options. include_extra_comments {
1373
1373
let mut extra_comments = ExtraComments { tcx, comments : vec ! [ ] } ;
0 commit comments