@@ -22,7 +22,7 @@ impl Debug for Place {
2222}
2323
2424pub ( 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 }(" ) ?;
2626 body. arg_locals ( )
2727. iter ( )
2828. enumerate ( )
@@ -54,7 +54,7 @@ pub(crate) fn function_body<W: Write>(writer: &mut W, body: &Body, name: &str) -
5454. iter ( )
5555. enumerate ( )
5656. map ( |( index, block) | -> io:: Result < ( ) > {
57- writeln ! ( writer, " bb{}: {{" , index ) ?;
57+ writeln ! ( writer, " bb{index }: {{" ) ?;
5858let _ = block
5959. statements
6060. iter ( )
@@ -75,7 +75,7 @@ pub(crate) fn function_body<W: Write>(writer: &mut W, body: &Body, name: &str) -
7575fn pretty_statement < W : Write > ( writer : & mut W , statement : & StatementKind ) -> io:: Result < ( ) > {
7676match statement {
7777StatementKind :: Assign ( place, rval) => {
78- write ! ( writer, " {:?} = " , place ) ?;
78+ write ! ( writer, " {place :?} = " ) ?;
7979pretty_rvalue ( writer, rval) ?;
8080writeln ! ( writer, ";" )
8181}
@@ -165,7 +165,7 @@ fn pretty_terminator_head<W: Write>(writer: &mut W, terminator: &TerminatorKind)
165165Abort => write ! ( writer, "{INDENT}abort" ) ,
166166Return => write ! ( writer, "{INDENT}return" ) ,
167167Unreachable => write ! ( writer, "{INDENT}unreachable" ) ,
168- Drop { place, .. } => write ! ( writer, "{INDENT}drop({:?})" , place ) ,
168+ Drop { place, .. } => write ! ( writer, "{INDENT}drop({place :?})" ) ,
169169Call { func, args, destination, .. } => {
170170write ! ( writer, "{INDENT}{:?} = {}(" , destination, pretty_operand( func) ) ?;
171171let mut args_iter = args. iter ( ) ;
@@ -304,10 +304,10 @@ fn pretty_assert_message<W: Write>(writer: &mut W, msg: &AssertMessage) -> io::R
304304fn pretty_operand ( operand : & Operand ) -> String {
305305match operand {
306306Operand :: Copy ( copy) => {
307- format ! ( "{:?}" , copy )
307+ format ! ( "{copy :?}" )
308308}
309309Operand :: Move ( mv) => {
310- format ! ( "move {:?}" , mv )
310+ format ! ( "move {mv :?}" )
311311}
312312Operand :: Constant ( cnst) => pretty_mir_const ( & cnst. const_ ) ,
313313}
@@ -344,13 +344,13 @@ fn pretty_rvalue<W: Write>(writer: &mut W, rval: &Rvalue) -> io::Result<()> {
344344write ! ( writer, "Checked{:?}({}, {})" , bin, pretty_operand( op1) , pretty_operand( op2) )
345345}
346346Rvalue :: CopyForDeref ( deref) => {
347- write ! ( writer, "CopyForDeref({:?})" , deref )
347+ write ! ( writer, "CopyForDeref({deref :?})" )
348348}
349349Rvalue :: Discriminant ( place) => {
350- write ! ( writer, "discriminant({:?})" , place )
350+ write ! ( writer, "discriminant({place :?})" )
351351}
352352Rvalue :: Len ( len) => {
353- write ! ( writer, "len({:?})" , len )
353+ write ! ( writer, "len({len :?})" )
354354}
355355Rvalue :: Ref ( _, borrowkind, place) => {
356356let kind = match borrowkind {
@@ -359,17 +359,17 @@ fn pretty_rvalue<W: Write>(writer: &mut W, rval: &Rvalue) -> io::Result<()> {
359359BorrowKind :: Fake ( FakeBorrowKind :: Shallow ) => "&fake shallow " ,
360360BorrowKind :: Mut { .. } => "&mut " ,
361361} ;
362- write ! ( writer, "{kind}{:?}" , place )
362+ write ! ( writer, "{kind}{place :?}" )
363363}
364364Rvalue :: Repeat ( op, cnst) => {
365365write ! ( writer, "{} \" \" {}" , pretty_operand( op) , pretty_ty_const( cnst) )
366366}
367367Rvalue :: ShallowInitBox ( _, _) => Ok ( ( ) ) ,
368368Rvalue :: ThreadLocalRef ( item) => {
369- write ! ( writer, "thread_local_ref{:?}" , item )
369+ write ! ( writer, "thread_local_ref{item :?}" )
370370}
371371Rvalue :: NullaryOp ( nul, ty) => {
372- write ! ( writer, "{:?} {} \" \" " , nul , ty )
372+ write ! ( writer, "{nul :?} {ty } \" \" " )
373373}
374374Rvalue :: UnaryOp ( un, op) => {
375375write ! ( writer, "{} \" \" {:?}" , pretty_operand( op) , un)
0 commit comments