]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_mir_build/src/build/misc.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / compiler / rustc_mir_build / src / build / misc.rs
index 3516eca1c1469663a2c7c2b83cde4fc2a75d71f2..84762d602f8db5030f46e9c4046ed9f3000bf833 100644 (file)
@@ -3,6 +3,7 @@
 
 use crate::build::Builder;
 
+use rustc_middle::mir;
 use rustc_middle::mir::*;
 use rustc_middle::ty::{self, Ty};
 use rustc_span::{Span, DUMMY_SP};
@@ -25,8 +26,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
 
     /// 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)
     }
@@ -34,7 +38,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
     // 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)
     }