Skip to content

Commit 3855520

Browse files
committed
minor clarifications
1 parent 1a7110b commit 3855520

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

text/0000-compile-time-asserts.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ call __gnat_rcheck_CE_Range_Check
7878
The PRs https://github.com/rust-lang/rust/pull/26848 and https://github.com/rust-lang/rust/pull/25570 will be setting a precedent
7979
for warning about such situations (WIP, not pushed yet).
8080
All future additions to the const-evaluator need to notify the const evaluator
81-
that when it encounters a statically known erroneous situation, the
81+
that when it encounters a statically known erroneous situation while evaluating
82+
an expression outside of a constant evaluation environment, the
8283
entire expression must be replaced by a panic and a warning must be emitted.
8384

8485
# Drawbacks
@@ -93,10 +94,13 @@ Let the compiler error on things that will unconditionally panic at runtime.
9394

9495
## only warn, don't influence code generation
9596

97+
The const evaluator should simply issue a warning and notify it's caller that the expression cannot be evaluated and should be translated.
9698
This has the disadvantage, that in release-mode statically known issues like
9799
overflow or shifting more than the number of bits available will not be
98100
caught even at runtime.
99101

102+
On the other hand, this alternative does not change the behavior of existing code.
103+
100104
# Unresolved questions
101105

102106
How to implement this?

0 commit comments

Comments
 (0)