Skip to content

Commit 40c2087

Browse files
committed
We can make const eval sound, it's just super expensive
1 parent dd9702a commit 40c2087

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/test/ui/consts/const-eval/double_check2.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
// check-pass
22

3-
// This test exhibits undefined behavior, but it is impossible to prevent generally during
4-
// const eval, even if it could be prevented in the cases here if we added expensive and
5-
// complex checks in rustc.
6-
// The reason it's impossible in general
7-
// is that we run into query cycles even *without* UB, just because we're checking for UB.
8-
// We do not detect it if you create references to statics
9-
// in ways that are UB.
3+
// This test exhibits undefined behavior, but it is very expensive and complex to check for such
4+
// UB in constants.
5+
// Thus, we do not detect it if you create references to statics in ways that are UB.
106

117
enum Foo {
128
A = 5,

0 commit comments

Comments
 (0)