do use ty::Const in patterns and abstract consts

This commit is contained in:
b-naber
2022-03-09 13:56:12 +01:00
parent b38077ea0b
commit ac60db231c
15 changed files with 105 additions and 127 deletions

View 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,7 +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: ConstantKind<'tcx>) -> Operand<'tcx> {
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)
}