Skip to content

Commit 9a45f33

Browse files
committed
Add note about "why not have these checks on by default"
1 parent 25cbfb7 commit 9a45f33

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

posts/2022-09-15-const-eval-safety-rule-revision.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,14 @@ compiler highlights the expression where we can first witness UB: the original
171171
transmute itself! (Which was stated at the outset of this post; here we are just
172172
pointing out that these tools can pinpoint the injection point more precisely.)
173173

174+
Why not have these extra const-ub checks on by default? Well, the checks
175+
introduce performance overhead upon Rust compilation time, and we do not know if
176+
that overhead can be made acceptable. However, [recent debate][perf argument]
177+
among Miri developers indicates that the inherent cost here might not be as bad
178+
as they had originally thought.
179+
180+
[perf argument]: https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bsteering.20meeting.5D.202022-09-02.20const-eval.20and.20future-compa.2E.2E.2E/near/296853344
181+
174182
## Change is hard
175183

176184
You might well be wondering at this point: "Wait, when *is* it okay to transmute

0 commit comments

Comments
 (0)