Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate constants during const_eval_raw #74949

Merged
merged 18 commits into from
Sep 20, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clarify a statement in UB test
  • Loading branch information
oli-obk committed Sep 19, 2020
commit a6c60bbe5de9a090c8da30d5edbd27582f6b19e6
4 changes: 3 additions & 1 deletion src/test/ui/consts/const-eval/double_check2.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// check-pass

// This test exhibits undefined behavior, but it is impossible to prevent generally during
// const eval, even if possible to prevent in the cases here. The reason it's impossible in general
// const eval, even if it could be prevented in the cases here if we added expensive and
// complex checks in rustc.
// The reason it's impossible in general
oli-obk marked this conversation as resolved.
Show resolved Hide resolved
// is that we run into query cycles even *without* UB, just because we're checking for UB.
// We do not detect it if you create references to statics
// in ways that are UB.
Expand Down