asm: When pretty-printing, don't escape characters twice
pprust uses `print_string` to write out the template string, and `print_string` already calls `escape_debug`, so `impl fmt::Display for InlineAsmTemplatePiece` shouldn't do an additional `escape_debug`. This fixes a pretty-printing bug that translated `asm!("...\n...")` to `asm!("...\\n...")`
This commit is contained in:
parent
840176ab6f
commit
50d6d4de67
1 changed files with 1 additions and 1 deletions
|
@ -1914,7 +1914,7 @@ impl fmt::Display for InlineAsmTemplatePiece {
|
||||||
match c {
|
match c {
|
||||||
'{' => f.write_str("{{")?,
|
'{' => f.write_str("{{")?,
|
||||||
'}' => f.write_str("}}")?,
|
'}' => f.write_str("}}")?,
|
||||||
_ => write!(f, "{}", c.escape_debug())?,
|
_ => c.fmt(f)?,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue