Skip to content

Commit 0dbea7a

Browse files
committed
Close parentheses for offset_of in AST pretty printing
HIR pretty printing already handles it correctly.
1 parent f2eb9f8 commit 0dbea7a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

compiler/rustc_ast_pretty/src/pprust/state/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ impl<'a> State<'a> {
566566
self.print_ident(field);
567567
}
568568
}
569-
569+
self.pclose();
570570
self.end();
571571
}
572572
ast::ExprKind::MacCall(m) => self.print_mac(m),

tests/pretty/offset_of.rs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// pp-exact
2+
#![feature(offset_of)]
3+
4+
fn main() { std::mem::offset_of!(std :: ops :: Range < usize >, end); }

0 commit comments

Comments
 (0)