@@ -51,6 +51,9 @@ earlier version of miri used to panic on arithmetic overflow even in release
5151mode. This breaks promotion, because now promoting code that would work (and
5252could not panic!) at run-time leads to a compile-time CTFE error.
5353
54+ * Dynamic check.* The Miri engine already dynamically detects panics, but the
55+ main point of promoteds is ruling them out statically.
56+
5457### 2. Const safety
5558
5659We have explained what happens when evaluating a promoted panics, but what about
@@ -94,6 +97,9 @@ but to abort compilation of a program that would have compiled fine if we would
9497not have decided to promote. It is the responsibility of ` foo ` to not fail this
9598way when working with const-safe arguments.
9699
100+ * Dynamic check.* The Miri engine already dynamically detects const safety
101+ violations, but the main point of promoteds is ruling them out statically.
102+
97103### 3. Drop
98104
99105Expressions returning "needs drop" types can never be promoted. If such an
@@ -110,6 +116,9 @@ it is unlikely to be the desired behavior in most cases and very likey to be con
110116to the user. If such behavior is desired, the user can still use an explicit ` static `
111117or ` const ` item and refer to that.
112118
119+ * Dynamic check.* The Miri engine could dynamically check this by ensuring that
120+ the result of computing a promoted is a value that does not need dropping.
121+
113122## ` & ` in ` const ` and ` static `
114123
115124Promotion is also responsible for making code like this work:
0 commit comments