Don't print addr_of(addr_of(e)) as &&e
, which means something else.
This commit is contained in:
parent
2e29f97423
commit
5066bc9ff4
@ -1217,6 +1217,11 @@ pub fn print_expr(s: @ps, &&expr: @ast::expr) {
|
||||
ast::expr_addr_of(m, expr) => {
|
||||
word(s.s, ~"&");
|
||||
print_mutability(s, m);
|
||||
// Avoid `& &e` => `&&e`.
|
||||
match (m, &expr.node) {
|
||||
(ast::m_imm, &ast::expr_addr_of(*)) => space(s.s),
|
||||
_ => { }
|
||||
}
|
||||
print_expr(s, expr);
|
||||
}
|
||||
ast::expr_lit(lit) => print_literal(s, lit),
|
||||
|
Loading…
x
Reference in New Issue
Block a user