Skip to content

Commit d3d5905

Browse files
committed
Fix uninlined_format_args in stable_mir
1 parent 88f3114 commit d3d5905

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

‎compiler/stable_mir/src/mir/pretty.rs‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl Debug for Place {
2222
}
2323

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

0 commit comments

Comments
 (0)