@@ -22,7 +22,7 @@ impl Debug for Place {
22
22
}
23
23
24
24
pub ( crate ) fn function_body < W : Write > ( writer : & mut W , body : & Body , name : & str ) -> io:: Result < ( ) > {
25
- write ! ( writer, "fn {}(" , name ) ?;
25
+ write ! ( writer, "fn {name }(" ) ?;
26
26
body. arg_locals ( )
27
27
. iter ( )
28
28
. enumerate ( )
@@ -54,7 +54,7 @@ pub(crate) fn function_body<W: Write>(writer: &mut W, body: &Body, name: &str) -
54
54
. iter ( )
55
55
. enumerate ( )
56
56
. map ( |( index, block) | -> io:: Result < ( ) > {
57
- writeln ! ( writer, " bb{}: {{" , index ) ?;
57
+ writeln ! ( writer, " bb{index }: {{" ) ?;
58
58
let _ = block
59
59
. statements
60
60
. iter ( )
@@ -75,7 +75,7 @@ pub(crate) fn function_body<W: Write>(writer: &mut W, body: &Body, name: &str) -
75
75
fn pretty_statement < W : Write > ( writer : & mut W , statement : & StatementKind ) -> io:: Result < ( ) > {
76
76
match statement {
77
77
StatementKind :: Assign ( place, rval) => {
78
- write ! ( writer, " {:?} = " , place ) ?;
78
+ write ! ( writer, " {place :?} = " ) ?;
79
79
pretty_rvalue ( writer, rval) ?;
80
80
writeln ! ( writer, ";" )
81
81
}
@@ -165,7 +165,7 @@ fn pretty_terminator_head<W: Write>(writer: &mut W, terminator: &TerminatorKind)
165
165
Abort => write ! ( writer, "{INDENT}abort" ) ,
166
166
Return => write ! ( writer, "{INDENT}return" ) ,
167
167
Unreachable => write ! ( writer, "{INDENT}unreachable" ) ,
168
- Drop { place, .. } => write ! ( writer, "{INDENT}drop({:?})" , place ) ,
168
+ Drop { place, .. } => write ! ( writer, "{INDENT}drop({place :?})" ) ,
169
169
Call { func, args, destination, .. } => {
170
170
write ! ( writer, "{INDENT}{:?} = {}(" , destination, pretty_operand( func) ) ?;
171
171
let mut args_iter = args. iter ( ) ;
@@ -304,10 +304,10 @@ fn pretty_assert_message<W: Write>(writer: &mut W, msg: &AssertMessage) -> io::R
304
304
fn pretty_operand ( operand : & Operand ) -> String {
305
305
match operand {
306
306
Operand :: Copy ( copy) => {
307
- format ! ( "{:?}" , copy )
307
+ format ! ( "{copy :?}" )
308
308
}
309
309
Operand :: Move ( mv) => {
310
- format ! ( "move {:?}" , mv )
310
+ format ! ( "move {mv :?}" )
311
311
}
312
312
Operand :: Constant ( cnst) => pretty_mir_const ( & cnst. const_ ) ,
313
313
}
@@ -344,13 +344,13 @@ fn pretty_rvalue<W: Write>(writer: &mut W, rval: &Rvalue) -> io::Result<()> {
344
344
write ! ( writer, "Checked{:?}({}, {})" , bin, pretty_operand( op1) , pretty_operand( op2) )
345
345
}
346
346
Rvalue :: CopyForDeref ( deref) => {
347
- write ! ( writer, "CopyForDeref({:?})" , deref )
347
+ write ! ( writer, "CopyForDeref({deref :?})" )
348
348
}
349
349
Rvalue :: Discriminant ( place) => {
350
- write ! ( writer, "discriminant({:?})" , place )
350
+ write ! ( writer, "discriminant({place :?})" )
351
351
}
352
352
Rvalue :: Len ( len) => {
353
- write ! ( writer, "len({:?})" , len )
353
+ write ! ( writer, "len({len :?})" )
354
354
}
355
355
Rvalue :: Ref ( _, borrowkind, place) => {
356
356
let kind = match borrowkind {
@@ -359,17 +359,17 @@ fn pretty_rvalue<W: Write>(writer: &mut W, rval: &Rvalue) -> io::Result<()> {
359
359
BorrowKind :: Fake ( FakeBorrowKind :: Shallow ) => "&fake shallow " ,
360
360
BorrowKind :: Mut { .. } => "&mut " ,
361
361
} ;
362
- write ! ( writer, "{kind}{:?}" , place )
362
+ write ! ( writer, "{kind}{place :?}" )
363
363
}
364
364
Rvalue :: Repeat ( op, cnst) => {
365
365
write ! ( writer, "{} \" \" {}" , pretty_operand( op) , pretty_ty_const( cnst) )
366
366
}
367
367
Rvalue :: ShallowInitBox ( _, _) => Ok ( ( ) ) ,
368
368
Rvalue :: ThreadLocalRef ( item) => {
369
- write ! ( writer, "thread_local_ref{:?}" , item )
369
+ write ! ( writer, "thread_local_ref{item :?}" )
370
370
}
371
371
Rvalue :: NullaryOp ( nul, ty) => {
372
- write ! ( writer, "{:?} {} \" \" " , nul , ty )
372
+ write ! ( writer, "{nul :?} {ty } \" \" " )
373
373
}
374
374
Rvalue :: UnaryOp ( un, op) => {
375
375
write ! ( writer, "{} \" \" {:?}" , pretty_operand( op) , un)
0 commit comments