File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,8 @@ call __gnat_rcheck_CE_Range_Check
78
78
The PRs https://github.com/rust-lang/rust/pull/26848 and https://github.com/rust-lang/rust/pull/25570 will be setting a precedent
79
79
for warning about such situations (WIP, not pushed yet).
80
80
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
82
83
entire expression must be replaced by a panic and a warning must be emitted.
83
84
84
85
# Drawbacks
@@ -93,10 +94,13 @@ Let the compiler error on things that will unconditionally panic at runtime.
93
94
94
95
## only warn, don't influence code generation
95
96
97
+ The const evaluator should simply issue a warning and notify it's caller that the expression cannot be evaluated and should be translated.
96
98
This has the disadvantage, that in release-mode statically known issues like
97
99
overflow or shifting more than the number of bits available will not be
98
100
caught even at runtime.
99
101
102
+ On the other hand, this alternative does not change the behavior of existing code.
103
+
100
104
# Unresolved questions
101
105
102
106
How to implement this?
You can’t perform that action at this time.
0 commit comments