-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
NLL: Add union justifications to conflicting borrows. #57102
Merged
Merged
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
This comment has been minimized.
This comment has been minimized.
d7216a7
to
a6f5d83
Compare
This comment has been minimized.
This comment has been minimized.
a6f5d83
to
aaec069
Compare
This comment has been minimized.
This comment has been minimized.
aaec069
to
e33afe6
Compare
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..``.
e33afe6
to
69bded2
Compare
nikomatsakis
reviewed
Jan 2, 2019
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
I'm not sure about saying that we "borrow" @bors r+ |
📌 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.
⌛ Testing commit c2b477c with merge c62ef99698f561711103e57302deb5f9713489af... |
💔 Test failed - status-appveyor |
@bors retry |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Jan 13, 2019
NLL: Add union justifications to conflicting borrows. Fixes rust-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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
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