diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-12-22 21:31:24 +0100 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-12-26 22:50:18 +0100 |
| commit | b476344ccc877cd0a2bdb5673928f51fd80b4a79 (patch) | |
| tree | f96bb778b8352fd783b1c60f9fc0ae22d6c2aa4c | |
| parent | 1531c3937bb93778dad60c0352891464aa0e00bd (diff) | |
| download | rust-b476344ccc877cd0a2bdb5673928f51fd80b4a79.tar.gz rust-b476344ccc877cd0a2bdb5673928f51fd80b4a79.zip | |
Reintroduce the recursion comment
| -rw-r--r-- | src/librustc_mir/interpret/eval_context.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs index da4156c2719..bc158a767ce 100644 --- a/src/librustc_mir/interpret/eval_context.rs +++ b/src/librustc_mir/interpret/eval_context.rs @@ -769,6 +769,10 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { self.param_env }; let val = self.tcx.const_eval(param_env.and(gid))?; + // Even though `ecx.const_eval` is called from `eval_const_to_op` we can never have a + // recursion deeper than one level, because the `tcx.const_eval` above is guaranteed to not + // return `ConstValue::Unevaluated`, which is the only way that `eval_const_to_op` will call + // `ecx.const_eval`. self.eval_const_to_op(val, None) } |
