1
Fork 0

Lower inline const down to MIR

This commit is contained in:
Santiago Pastorino 2020-10-06 17:51:15 -03:00
parent 66e254314d
commit fe922e567f
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
12 changed files with 41 additions and 1 deletions

View file

@ -1135,6 +1135,15 @@ impl<'a> State<'a> {
self.end()
}
fn print_expr_anon_const(&mut self, anon_const: &hir::AnonConst) {
self.ibox(INDENT_UNIT);
self.s.word_space("const");
self.s.word("{");
self.print_anon_const(anon_const);
self.s.word("}");
self.end()
}
fn print_expr_repeat(&mut self, element: &hir::Expr<'_>, count: &hir::AnonConst) {
self.ibox(INDENT_UNIT);
self.s.word("[");
@ -1287,6 +1296,9 @@ impl<'a> State<'a> {
hir::ExprKind::Array(ref exprs) => {
self.print_expr_vec(exprs);
}
hir::ExprKind::ConstBlock(ref anon_const) => {
self.print_expr_anon_const(anon_const);
}
hir::ExprKind::Repeat(ref element, ref count) => {
self.print_expr_repeat(&element, count);
}