-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Stop treating FalseEdges
and FalseUnwind
as having semantic value for const eval
#68314
Conversation
FalseEdges
and FalseUnwind
as having semantic value…FalseEdges
and FalseUnwind
as having semantic value for const eval
} | ||
|
||
TerminatorKind::FalseUnwind { .. } => { | ||
Err((span, "loops are not allowed in const fn".into())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, if @Centril wants to keep a check in here, I would suggest doing something like this instead (i.e. query is_cfg_cyclic
instead of relying on coincidences), for a correct approach:
rust/src/librustc_mir/transform/check_consts/validation.rs
Lines 191 to 195 in 71c6346
if body.is_cfg_cyclic() { | |
// We can't provide a good span for the error here, but this should be caught by the | |
// HIR const-checker anyways. | |
self.check_op_spanned(ops::Loop, body.span); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this. :)
@bors r+ |
📌 Commit cdc828e has been approved by |
Stop treating `FalseEdges` and `FalseUnwind` as having semantic value for const eval This change does not expose loops or conditions to stable const fns because we check those at the HIR level and in the regular const validity checks. cc @ecstatic-morse r? @eddyb
Stop treating `FalseEdges` and `FalseUnwind` as having semantic value for const eval This change does not expose loops or conditions to stable const fns because we check those at the HIR level and in the regular const validity checks. cc @ecstatic-morse r? @eddyb
Stop treating `FalseEdges` and `FalseUnwind` as having semantic value for const eval This change does not expose loops or conditions to stable const fns because we check those at the HIR level and in the regular const validity checks. cc @ecstatic-morse r? @eddyb
Rollup of 9 pull requests Successful merges: - #66660 (Don't warn about snake case for field puns.) - #68093 (Fix deref impl typedef) - #68204 (Use named fields for `{ast,hir}::ItemKind::Impl`) - #68256 (Do not ICE on malformed suggestion spans) - #68279 (Clean up E0198 explanation) - #68291 (Update sanitizer tests) - #68312 (Add regression test for integer literals in generic arguments in where clauses) - #68314 (Stop treating `FalseEdges` and `FalseUnwind` as having semantic value for const eval) - #68317 (Clean up E0199 explanation) Failed merges: r? @ghost
This change does not expose loops or conditions to stable const fns because we check those at the HIR level and in the regular const validity checks.
cc @ecstatic-morse
r? @eddyb