Subtype FRU fields first in type_changing_struct_update#98013
Merged
bors merged 1 commit intorust-lang:masterfrom Jun 17, 2022
Merged
Subtype FRU fields first in type_changing_struct_update#98013bors merged 1 commit intorust-lang:masterfrom
type_changing_struct_update#98013bors merged 1 commit intorust-lang:masterfrom
Conversation
compiler-errors
commented
Jun 14, 2022
lcnr
reviewed
Jun 14, 2022
lcnr
reviewed
Jun 14, 2022
Contributor
lcnr
left a comment
There was a problem hiding this comment.
so to summarize:
The current approach first does subtyping + opt coercion from the base expr to TargetTy<?0..?N> where ?0 to ?N are fresh inference var.
The second approach first does subtyping of TargetTy<?0..?N> to our actual target ty and then does subtyping + coercions between the inferred target ty and the base type.
The new approach can do more coercions as we know more about the target type at that point.
Contributor
|
two nits, then r=me |
0ec16f3 to
784e28e
Compare
Contributor
Author
|
@bors r=lcnr |
Collaborator
|
📌 Commit 784e28e has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 17, 2022
Rollup of 5 pull requests Successful merges: - rust-lang#95392 (std: Stabilize feature try_reserve_2 ) - rust-lang#97798 (Hide irrelevant lines in suggestions to allow for suggestions that are far from each other to be shown) - rust-lang#97844 (Windows: No panic if function not (yet) available) - rust-lang#98013 (Subtype FRU fields first in `type_changing_struct_update`) - rust-lang#98191 (Remove the rest of unnecessary `to_string`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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 free
to 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.
So this fixes a subtle bug that
type_changing_struct_updateintroduced, where it'll no longer coerce the base expr correctly. I actually think this code is easier to understand now, too.r? @lcnr since you reviewed the last one