File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,13 @@ limitation with the CTFE engine. While writing `let x = {expr}` outside of a
122122const context, the user likely expects that ` x ` will live on the stack and be
123123initialized at run-time. Although this is not (to my knowledge) guaranteed by
124124the language, we do not wish to violate the user's expectations here.
125- (Constant-folding still applies: the optimizer may compute ` x ` at compile-time
126- and even inline it everywhere if it can show that this does not observably alter
127- program behavior. Promotion is very different from constant-folding as
128- promotion can introduce observable differences in behavior.)
125+
126+ However, constant-folding still applies: the optimizer may compute ` x ` at
127+ compile-time and even inline it everywhere if it can show that this does not
128+ observably alter program behavior. Promotion is very different from
129+ constant-folding as promotion can introduce observable differences in behavior
130+ (if const-evaluation fails) and as it is * guaranteed* to happen in some cases
131+ (and thus exploited by the borrow checker).
129132
130133### Single assignment
131134
You can’t perform that action at this time.
0 commit comments