Refactorings in preparation for the removal of the leak check#50397
Merged
bors merged 10 commits intorust-lang:masterfrom May 4, 2018
Merged
Refactorings in preparation for the removal of the leak check#50397bors merged 10 commits intorust-lang:masterfrom
bors merged 10 commits intorust-lang:masterfrom
Conversation
Always using root environment for now.
This gives each type inference variable a notion of universe but doesn't do anything with it. We can always get the "current universe" from infer_ctxt. This relies on the property of type variables that they can never interact with siblings.
This is sort of confusing "side step". All it does is to change the representation of a skolemized region. but the source of that universe index is not the inference context, which is what we eventually want, but rather an internal counter in the region inference context. We'll patch that up later. But doing this now ought to help with confusing diffs later.
We'll need this in order to start tracking skolemizatoins here, and it's easier to update all the field accesses now rather than later.
nikomatsakis
approved these changes
May 2, 2018
| (&TypeVariableValue::Unknown, &TypeVariableValue::Unknown) => Ok(*value1), | ||
| (&TypeVariableValue::Unknown { universe: universe1 }, | ||
| &TypeVariableValue::Unknown { universe: universe2 }) => { | ||
| let universe = cmp::min(universe1, universe2); |
Contributor
There was a problem hiding this comment.
Might be worth adding a comment here. Something like this:
If we have two unbound variables, ?T and ?U, that get unified, then whatever value they wind up taking (which must be the same value) must be nameable by both. Therefore, the resulting universe is the minimum of the two universes, because that is the one which contains the fewest names in scope.
Contributor
|
@bors r+ Nice |
Collaborator
|
📌 Commit 68a1fdf has been approved by |
Collaborator
bors
added a commit
that referenced
this pull request
May 4, 2018
…matsakis Refactorings in preparation for the removal of the leak check This contains all of the commits from #48407 that I was able to pull out on their own. This has most of the refactoring/ground work to unblock other work, but without the behavior changes that still need a crater run and NLL changes. r? @nikomatsakis
Collaborator
|
☀️ Test successful - status-appveyor, status-travis |
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.
This contains all of the commits from #48407 that I was able to pull out on their own. This has most of the refactoring/ground work to unblock other work, but without the behavior changes that still need a crater run and NLL changes.
r? @nikomatsakis