Uh oh!
There was an error while loading. Please reload this page.
NLL: Add union justifications to conflicting borrows. - #57102
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This commit adds justifications to error messages for conflicting borrows of union fields. Where previously an error message would say ``cannot borrow `u.b` as mutable..``, it now says ``cannot borrow `u` (via `u.b`) as mutable..``.
davidtwco
commented
Dec 30, 2018
MemberAuthor
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This commit improves the logic for place descriptions in conflicting borrow errors so that borrows of union fields have better messages even when the unions are embedded in other unions or structs.
This commit improves diagnostic labels to mention which field a borrow overlaps with and adds a note explaining that the fields overlap.
nikomatsakis
approved these changes
Jan 8, 2019
nikomatsakis
commented
Jan 8, 2019
Contributor
I'm not sure about saying that we "borrow" @bors r+ |
bors
commented
Jan 8, 2019
Collaborator
📌 Commit c2b477c has been approved by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
davidtwco
commented
Jan 9, 2019
MemberAuthor
bors
commented
Jan 10, 2019
Collaborator
⌛ Testing commit c2b477c with merge c62ef99698f561711103e57302deb5f9713489af... |
bors
commented
Jan 10, 2019
Collaborator
💔 Test failed - status-appveyor |
emilyalbini
commented
Jan 10, 2019
Member
@bors retry |
Centril added a commit
to Centril/rust
that referenced
this pull request
Jan 13, 2019
NLL: Add union justifications to conflicting borrows. Fixesrust-lang#57100. This PR adds justifications to error messages for conflicting borrows of union fields. Where previously an error message would say ``cannot borrow `u.b` as mutable..``, it now says ``cannot borrow `u` (via `u.b`) as mutable..``. r? @pnkfelix
bors added a commit
that referenced
this pull request
Jan 13, 2019
Rollup of 4 pull requests Successful merges: - #57004 (Make `TokenStream` less recursive.) - #57102 (NLL: Add union justifications to conflicting borrows.) - #57337 (rustc: Place wasm linker args first instead of last) - #57549 (Add #[must_use] message to Iterator and Future) Failed merges: r? @ghost
This file contains hidden or 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
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes#57100.
This PR adds justifications to error messages for conflicting borrows of union fields.
Where previously an error message would say
cannot borrow `u.b` as mutable.., it now sayscannot borrow `u` (via `u.b`) as mutable...r? @pnkfelix