diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-12-13 10:04:28 +0100 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-01-01 20:05:02 +0100 |
| commit | bb9f717a80814165dcdb4fa3f9d37a6551bcb264 (patch) | |
| tree | e820572c98b86ee5ba0995a11329f53f523293b0 /src | |
| parent | f36c6559eabef7ad74818f8f7d952a474c64feaa (diff) | |
| download | rust-bb9f717a80814165dcdb4fa3f9d37a6551bcb264.tar.gz rust-bb9f717a80814165dcdb4fa3f9d37a6551bcb264.zip | |
`const_to_op` is now `lazy_const_to_op`
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/const_eval.rs | 6 | ||||
| -rw-r--r-- | src/librustc_mir/transform/const_prop.rs | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_mir/const_eval.rs b/src/librustc_mir/const_eval.rs index 58a0f13733e..2722355b050 100644 --- a/src/librustc_mir/const_eval.rs +++ b/src/librustc_mir/const_eval.rs @@ -137,7 +137,7 @@ pub fn op_to_const<'tcx>( Ok(ty::Const::from_const_value(ecx.tcx.tcx, val, op.layout.ty)) } -pub fn const_to_op<'tcx>( +pub fn lazy_const_to_op<'tcx>( ecx: &CompileTimeEvalContext<'_, '_, 'tcx>, cnst: ty::LazyConst<'tcx>, ty: ty::Ty<'tcx>, @@ -516,7 +516,7 @@ pub fn const_field<'a, 'tcx>( let ecx = mk_eval_cx(tcx, instance, param_env).unwrap(); let result = (|| { // get the operand again - let op = const_to_op(&ecx, ty::LazyConst::Evaluated(value), value.ty)?; + let op = lazy_const_to_op(&ecx, ty::LazyConst::Evaluated(value), value.ty)?; // downcast let down = match variant { None => op, @@ -543,7 +543,7 @@ pub fn const_variant_index<'a, 'tcx>( ) -> EvalResult<'tcx, VariantIdx> { trace!("const_variant_index: {:?}, {:?}", instance, val); let ecx = mk_eval_cx(tcx, instance, param_env).unwrap(); - let op = const_to_op(&ecx, ty::LazyConst::Evaluated(val), val.ty)?; + let op = lazy_const_to_op(&ecx, ty::LazyConst::Evaluated(val), val.ty)?; Ok(ecx.read_discriminant(op)?.1) } diff --git a/src/librustc_mir/transform/const_prop.rs b/src/librustc_mir/transform/const_prop.rs index a2a416e54d8..2e72f80425d 100644 --- a/src/librustc_mir/transform/const_prop.rs +++ b/src/librustc_mir/transform/const_prop.rs @@ -20,7 +20,7 @@ use rustc::ty::layout::{ use interpret::{self, EvalContext, ScalarMaybeUndef, Immediate, OpTy, MemoryKind}; use const_eval::{ - CompileTimeInterpreter, const_to_op, error_to_const_error, eval_promoted, mk_borrowck_eval_cx + CompileTimeInterpreter, lazy_const_to_op, error_to_const_error, eval_promoted, mk_borrowck_eval_cx }; use transform::{MirPass, MirSource}; @@ -255,7 +255,7 @@ impl<'a, 'mir, 'tcx> ConstPropagator<'a, 'mir, 'tcx> { source_info: SourceInfo, ) -> Option<Const<'tcx>> { self.ecx.tcx.span = source_info.span; - match const_to_op(&self.ecx, *c.literal, c.ty) { + match lazy_const_to_op(&self.ecx, *c.literal, c.ty) { Ok(op) => { Some((op, c.span)) }, |
