introduce mir::Unevaluated
This commit is contained in:
parent
3e50038a2d
commit
9f3784df89
32 changed files with 166 additions and 132 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
use crate::build::{parse_float_into_constval, Builder};
|
||||
use rustc_ast as ast;
|
||||
use rustc_middle::mir;
|
||||
use rustc_middle::mir::interpret::{
|
||||
Allocation, ConstValue, LitToConstError, LitToConstInput, Scalar,
|
||||
};
|
||||
|
@ -66,7 +67,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
})
|
||||
});
|
||||
|
||||
let uneval = ty::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs);
|
||||
let uneval = mir::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs);
|
||||
let literal = ConstantKind::Unevaluated(uneval, ty);
|
||||
|
||||
Constant { user_ty, span, literal }
|
||||
|
@ -79,7 +80,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
Constant { user_ty: None, span, literal }
|
||||
}
|
||||
ExprKind::ConstBlock { did: def_id, substs } => {
|
||||
let uneval = ty::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs);
|
||||
let uneval = mir::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs);
|
||||
let literal = ConstantKind::Unevaluated(uneval, ty);
|
||||
|
||||
Constant { user_ty: None, span, literal }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue