diff options
| author | lcnr <rust@lcnr.de> | 2022-09-19 16:17:33 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2022-09-19 16:17:33 +0200 |
| commit | 526856768d1fcd78844e4b5aceeca9c871ba047d (patch) | |
| tree | 6ed3eee5aaac135971515aaf5acb6a4561d6d57a /compiler/rustc_const_eval/src/const_eval | |
| parent | 638b6121549f664b7fbff7f700294153248db178 (diff) | |
| download | rust-526856768d1fcd78844e4b5aceeca9c871ba047d.tar.gz rust-526856768d1fcd78844e4b5aceeca9c871ba047d.zip | |
ctfe, `const_to_op` only for mir constants
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/mod.rs b/compiler/rustc_const_eval/src/const_eval/mod.rs index d9c4ae4d53f..7cc2a93cdeb 100644 --- a/compiler/rustc_const_eval/src/const_eval/mod.rs +++ b/compiler/rustc_const_eval/src/const_eval/mod.rs @@ -103,7 +103,7 @@ pub(crate) fn try_destructure_mir_constant<'tcx>( ) -> InterpResult<'tcx, mir::DestructuredMirConstant<'tcx>> { trace!("destructure_mir_constant: {:?}", val); let ecx = mk_eval_cx(tcx, DUMMY_SP, param_env, false); - let op = ecx.mir_const_to_op(&val, None)?; + let op = ecx.const_to_op(&val, None)?; // We go to `usize` as we cannot allocate anything bigger anyway. let (field_count, variant, down) = match val.ty().kind() { @@ -139,7 +139,7 @@ pub(crate) fn deref_mir_constant<'tcx>( val: mir::ConstantKind<'tcx>, ) -> mir::ConstantKind<'tcx> { let ecx = mk_eval_cx(tcx, DUMMY_SP, param_env, false); - let op = ecx.mir_const_to_op(&val, None).unwrap(); + let op = ecx.const_to_op(&val, None).unwrap(); let mplace = ecx.deref_operand(&op).unwrap(); if let Some(alloc_id) = mplace.ptr.provenance { assert_eq!( |
