Skip to content

Commit 9de14d8

Browse files
authored
Rollup merge of rust-lang#111037 - Nilstrieb:close-the-offsetof, r=compiler-errors
Close parentheses for `offset_of` in AST pretty printing HIR pretty printing already handles it correctly. This will conflict with rust-lang#110694 but it seems like that PR is gonna take bit more time.
2 parents 7b488f4 + 0dbea7a commit 9de14d8

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)