File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ That's why we have to be very conservative with what can and cannot be promoted.
20
20
21
21
## Rules
22
22
23
- ### 1. Panics
23
+ ### Panics
24
24
25
25
Promotion is not allowed to throw away side effects. This includes panicking.
26
26
Let us look at what happens when we promote ` &(0_usize - 1) ` in a debug build:
@@ -56,7 +56,7 @@ could not panic!) at run-time leads to a compile-time CTFE error.
56
56
* Dynamic check.* The Miri engine already dynamically detects panics, but the
57
57
main point of promoteds is ruling them out statically.
58
58
59
- ### 2. Const safety
59
+ ### Const safety
60
60
61
61
We have explained what happens when evaluating a promoted panics, but what about
62
62
other kinds of failure -- what about hitting an unsupported operation or
@@ -105,7 +105,7 @@ For this reason, only `const fn` that were explicitly marked with the
105
105
* Dynamic check.* The Miri engine already dynamically detects const safety
106
106
violations, but the main point of promoteds is ruling them out statically.
107
107
108
- ### 3. Drop
108
+ ### Drop
109
109
110
110
Expressions returning "needs drop" types can never be promoted. If such an
111
111
expression were promoted, the ` Drop ` impl would never get called on the value,
You can’t perform that action at this time.
0 commit comments