Skip to content

Commit 87c3c87

Browse files
committed
we are less strict in const bodies
1 parent 7f8c81c commit 87c3c87

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

promotion.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ to the user. If such behavior is desired, the user can still use an explicit `st
122122
or `const` item and refer to that.
123123

124124
*Dynamic check.* The Miri engine could dynamically check this by ensuring that
125-
the result of computing a promoted is a value that does not need dropping.
125+
the result of computing a promoted is a value that does not need dropping.
126126

127127
## `&` in `const` and `static`
128128

@@ -135,8 +135,9 @@ const FOO: &'static i32 = {
135135
};
136136
```
137137

138-
However, since this is in explicit const context, we could be less strict about
139-
promotion in this situation.
138+
However, since this is in explicit const context, we are less strict about
139+
promotion in this situation: all function calls are promoted, not just
140+
`#[rustc_promotable]` functions.
140141

141142
Promotion is *not* involved in something like this:
142143

0 commit comments

Comments
 (0)