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.
72
72
73
73
However, things get more tricky when ` const ` and ` const fn ` are involved.
74
74
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 ) ,
76
76
we can rely on there not being const-unsafe values in the ` const ` , so we should
77
77
be able to promote freely. For example:
78
78
@@ -99,6 +99,9 @@ but to abort compilation of a program that would have compiled fine if we would
99
99
not have decided to promote. It is the responsibility of ` foo ` to not fail this
100
100
way when working with const-safe arguments.
101
101
102
+ For this reason, only ` const fn ` that were explicitly marked with the
103
+ ` #[rustc_promotable] ` attribute are subject to promotion.
104
+
102
105
* Dynamic check.* The Miri engine already dynamically detects const safety
103
106
violations, but the main point of promoteds is ruling them out statically.
104
107
You can’t perform that action at this time.
0 commit comments