mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Lower inline const's AST to HIR
This commit is contained in:
parent
59d07c3ae5
commit
66e254314d
@ -30,8 +30,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||||||
let kind = match e.kind {
|
let kind = match e.kind {
|
||||||
ExprKind::Box(ref inner) => hir::ExprKind::Box(self.lower_expr(inner)),
|
ExprKind::Box(ref inner) => hir::ExprKind::Box(self.lower_expr(inner)),
|
||||||
ExprKind::Array(ref exprs) => hir::ExprKind::Array(self.lower_exprs(exprs)),
|
ExprKind::Array(ref exprs) => hir::ExprKind::Array(self.lower_exprs(exprs)),
|
||||||
ExprKind::ConstBlock(_) => {
|
ExprKind::ConstBlock(ref anon_const) => {
|
||||||
unimplemented!();
|
let anon_const = self.lower_anon_const(anon_const);
|
||||||
|
hir::ExprKind::ConstBlock(anon_const)
|
||||||
}
|
}
|
||||||
ExprKind::Repeat(ref expr, ref count) => {
|
ExprKind::Repeat(ref expr, ref count) => {
|
||||||
let expr = self.lower_expr(expr);
|
let expr = self.lower_expr(expr);
|
||||||
|
@ -287,7 +287,7 @@ impl<'a> AstValidator<'a> {
|
|||||||
// ```
|
// ```
|
||||||
fn check_expr_within_pat(&self, expr: &Expr, allow_paths: bool) {
|
fn check_expr_within_pat(&self, expr: &Expr, allow_paths: bool) {
|
||||||
match expr.kind {
|
match expr.kind {
|
||||||
ExprKind::Lit(..) | ExprKind::Err => {}
|
ExprKind::Lit(..) | ExprKind::ConstBlock(..) | ExprKind::Err => {}
|
||||||
ExprKind::Path(..) if allow_paths => {}
|
ExprKind::Path(..) if allow_paths => {}
|
||||||
ExprKind::Unary(UnOp::Neg, ref inner) if matches!(inner.kind, ExprKind::Lit(_)) => {}
|
ExprKind::Unary(UnOp::Neg, ref inner) if matches!(inner.kind, ExprKind::Lit(_)) => {}
|
||||||
_ => self.err_handler().span_err(
|
_ => self.err_handler().span_err(
|
||||||
|
Loading…
Reference in New Issue
Block a user