use crate::build::Builder;
+use rustc_middle::mir;
use rustc_middle::mir::*;
use rustc_middle::ty::{self, Ty};
use rustc_span::{Span, DUMMY_SP};
/// Convenience function for creating a literal operand, one
/// without any user type annotation.
- crate fn literal_operand(&mut self, span: Span, literal: ty::Const<'tcx>) -> Operand<'tcx> {
- let literal = literal.into();
+ crate fn literal_operand(
+ &mut self,
+ span: Span,
+ literal: mir::ConstantKind<'tcx>,
+ ) -> Operand<'tcx> {
let constant = Box::new(Constant { span, user_ty: None, literal });
Operand::Constant(constant)
}
// Returns a zero literal operand for the appropriate type, works for
// bool, char and integers.
crate fn zero_literal(&mut self, span: Span, ty: Ty<'tcx>) -> Operand<'tcx> {
- let literal = ty::Const::from_bits(self.tcx, 0, ty::ParamEnv::empty().and(ty));
+ let literal = ConstantKind::from_bits(self.tcx, 0, ty::ParamEnv::empty().and(ty));
self.literal_operand(span, literal)
}