We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc8641a commit f646c1eCopy full SHA for f646c1e
compiler/rustc_mir/src/const_eval/mod.rs
@@ -44,7 +44,12 @@ pub(crate) fn const_to_valtree<'tcx>(
44
param_env: ty::ParamEnv<'tcx>,
45
raw: ConstAlloc<'tcx>,
46
) -> Option<ty::ValTree<'tcx>> {
47
- let ecx = mk_eval_cx(tcx, DUMMY_SP, param_env, false);
+ let ecx = mk_eval_cx(
48
+ tcx, DUMMY_SP, param_env,
49
+ // It is absolutely crucial for soundness that
50
+ // we do not read from static items or other mutable memory.
51
+ false,
52
+ );
53
let place = ecx.raw_const_to_mplace(raw).unwrap();
54
const_to_valtree_inner(&ecx, &place)
55
}
0 commit comments