-
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
LHS of assign op is invariant #52564
Merged
bors
merged 3 commits into
rust-lang:master
from
pnkfelix:issue-52126-lhs-of-assign-op-is-invariant
Jul 23, 2018
Merged
LHS of assign op is invariant #52564
bors
merged 3 commits into
rust-lang:master
from
pnkfelix:issue-52126-lhs-of-assign-op-is-invariant
Jul 23, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Therefore we cannot coerce it to a supertype the same way that we can the LHS of `+`. Addresses issue 52126.
… linker failure. Rather than try to work out what was happening, I just removed the flag because I see no reason for it to be on this test.
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jul 20, 2018
pnkfelix
added
the
beta-nominated
Nominated for backporting to the compiler in the beta channel.
label
Jul 20, 2018
r? @eddyb |
/facepalm of course (I probably completely missed that @bors r+ |
📌 Commit f153be6 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jul 20, 2018
bors
added a commit
that referenced
this pull request
Jul 22, 2018
…iant, r=eddyb LHS of assign op is invariant This addresses a bug injected by #45435. That PR changed the way we type-check `LHS <op> RHS` to coerce the LHS to the expected supertype in much the same way that we coerce the RHS. The problem is that when we have a case of `LHS <op>= RHS`, we do not want to coerce to a supertype; we need the type to remain invariant. Otherwise we risk leaking a value with short-lifetimes into a expression context that needs to satisfy a long lifetime. Fix #52126
☀️ Test successful - status-appveyor, status-travis |
pnkfelix
added
the
beta-accepted
Accepted for backporting to the compiler in the beta channel.
label
Jul 26, 2018
pietroalbini
removed
the
beta-nominated
Nominated for backporting to the compiler in the beta channel.
label
Jul 26, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
beta-accepted
Accepted for backporting to the compiler in the beta channel.
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses a bug injected by #45435. That PR changed the way we type-check
LHS <op> RHS
to coerce the LHS to the expected supertype in much the same way that we coerce the RHS.The problem is that when we have a case of
LHS <op>= RHS
, we do not want to coerce to a supertype; we need the type to remain invariant. Otherwise we risk leaking a value with short-lifetimes into a expression context that needs to satisfy a long lifetime.Fix #52126