Skip to content

Commit b476344

Browse files
committed
Reintroduce the recursion comment
1 parent 1531c39 commit b476344

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_mir/interpret/eval_context.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,10 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
769769
self.param_env
770770
};
771771
let val = self.tcx.const_eval(param_env.and(gid))?;
772+
// Even though `ecx.const_eval` is called from `eval_const_to_op` we can never have a
773+
// recursion deeper than one level, because the `tcx.const_eval` above is guaranteed to not
774+
// return `ConstValue::Unevaluated`, which is the only way that `eval_const_to_op` will call
775+
// `ecx.const_eval`.
772776
self.eval_const_to_op(val, None)
773777
}
774778

0 commit comments

Comments
 (0)