cl-ast: Fix AddrOf misbehavior

This commit is contained in:
2025-01-29 03:31:24 -06:00
parent bc955c6409
commit 518fbe74a1
7 changed files with 24 additions and 28 deletions

View File

@@ -616,11 +616,8 @@ mod display {
impl Display for AddrOf {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let Self { count, mutable, expr } = self;
for _ in 0..*count {
f.write_char('&')?;
}
write!(f, "{mutable}{expr}")
let Self { mutable, expr } = self;
write!(f, "&{mutable}{expr}")
}
}