}
ExprKind::Repeat { value, count } => {
let value_operand = unpack!(block = this.as_operand(block, value));
- let count = this.as_constant(count);
block.and(Rvalue::Repeat(value_operand, count))
}
ExprKind::Borrow { region, borrow_kind, arg } => {
hir::ExprRepeat(ref v, ref c) => ExprKind::Repeat {
value: v.to_ref(),
- count: Expr {
+ count: Constant {
ty: cx.tcx.expr_ty(c),
- temp_lifetime: None,
span: c.span,
- kind: ExprKind::Literal {
- literal: cx.const_eval_literal(c)
- }
- }.to_ref()
+ literal: cx.const_eval_literal(c)
+ }
},
hir::ExprRet(ref v) =>
ExprKind::Return { value: v.to_ref() },
//! unit-tested and separated from the Rust source and compiler data
//! structures.
-use rustc::mir::repr::{BinOp, BorrowKind, Field, Literal, Mutability, UnOp, ItemKind};
+use rustc::mir::repr::{Constant, BinOp, BorrowKind, Field, Literal, Mutability, UnOp, ItemKind};
use rustc::middle::const_eval::ConstVal;
use rustc::middle::def_id::DefId;
use rustc::middle::region::CodeExtent;
},
Repeat {
value: ExprRef<'tcx>,
- // FIXME(#29789): Add a separate hair::Constant<'tcx> so this could be more explicit about
- // its contained data. Currently this should only contain expression of ExprKind::Literal
- // kind.
- count: ExprRef<'tcx>,
+ count: Constant<'tcx>,
},
Vec {
fields: Vec<ExprRef<'tcx>>,
pub field: Field,
pub pattern: Pattern<'tcx>,
}
-
///////////////////////////////////////////////////////////////////////////
// The Mirror trait