File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ everything, so the only possible remaining failure are panics.
7272
7373However, things get more tricky when ` const ` and ` const fn ` are involved.
7474
75- For ` const ` , based on the const safety check described [ here] ( const_safety.md ) ,
75+ For ` const ` , based on the const safety check described [ here] ( const_safety.md#const-safety-check-on-values ) ,
7676we can rely on there not being const-unsafe values in the ` const ` , so we should
7777be able to promote freely. For example:
7878
@@ -99,6 +99,9 @@ but to abort compilation of a program that would have compiled fine if we would
9999not have decided to promote. It is the responsibility of ` foo ` to not fail this
100100way when working with const-safe arguments.
101101
102+ For this reason, only ` const fn ` that were explicitly marked with the
103+ ` #[rustc_promotable] ` attribute are subject to promotion.
104+
102105* Dynamic check.* The Miri engine already dynamically detects const safety
103106violations, but the main point of promoteds is ruling them out statically.
104107
You can’t perform that action at this time.
0 commit comments