-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Revert changes to inferred valid age that are not consistent with edges model assumed by precompile #58289
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
base: master
Are you sure you want to change the base?
Conversation
For example, the following code (invoking the method to add 1+1 with assume_effect added) is well-formed (if discouraged), and is not UB as implied by #58254:
I tried to ask for this code to be removed from the PR, but I guess I wasn't precise enough. FIXED: nothrow->consistent, since it is only an issue for consistent code (see comment below) |
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 don't think the revert is productive. Can you please be more precise what your actual concern is?
The world age bound affects the |
Okay, I fixed the example above to use consistent instead. I see: you want to express that the method is not valid before it was defined. That seems still incorrect though, since there's nothing semantically relevant to the method itself about that specific world. The PR also failed to define an edge against that method, so re-validation later will result in this being re-added to the valid range in unpredictable ways. For user-friendliness, we usually also have edges against the opposite branch now too (not required for correctness, but we normally do have them):
|
d77dcb6
to
c688e27
Compare
@assume_effects
:consistent"
The method is valid, but the consistency annotation is not |
)" This reverts the invalid functional changes from commit d7cd271, keeping only the doc updates.
c688e27
to
a80b5aa
Compare
Reverts only the code from #58254, not the docs
This adds unsound behavior to the Compiler in a doc PR that is supposed to be about increasing soundness. It isn't easily observable behavior, since the added code only triggers if code gets precompiled and saved and the Method gets used before its official "primary" world, but it can lead to unpredictable and inconsistent inference results.