Skip to content
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

[WIP] Region vid newtype index #45906

Closed

Conversation

spastorino
Copy link
Member

THIS SHOULD BE MERGED AFTER #45825 and probably after rebasing and force pushing :)
/cc @nikomatsakis

When we get around to resolving regions, we really ought to take region
obligations into account. There is one case where they are presently
being ignored. Keep ignoring them there for now but leave a TODO.
This helps make its inputs and outputs more clear.
This new way is **slightly** less expressive (I would be shocked if it
affects any code, though) when it comes to higher-ranked bounds or a
few other weird tricks. But we don't handle those consistently
regardless, and the new way does not require normalization and is just
wildly simpler.
Instead, just search the param env predicates directly. This is
equivalent to what we were doing before but more efficient.
Unquestionably there is more cleanup to be done, but I'm not sure what
it should look like yet, so leaving it roughly as is.
Temporary make various fields public.
This way, we can `take()` ownership of it when we are going to resolve regions.
nikomatsakis and others added 21 commits November 7, 2017 05:42
We are heading towards deeper integration with the region inference
system in infcx; in particular, prior to the creation of the
`RegionInferenceContext`, it will be the "owner" of the set of region
variables.
We've kind of got the same information twice in the MIR, between the
return-type field and the local-decls. Seems un-great.
The inference README, in particular, was VERY out of date!
This restores the behavior of regionck with respect to the
free-region-map: that is, it collects all the relations from the fn
and its closures. This feels a bit fishy but it's the behavior we've
had for some time, and it will go away with NLL, so seems best to just
keep it.
@spastorino spastorino changed the title Region vid newtype index [WIP] Region vid newtype index Nov 10, 2017
@shepmaster shepmaster added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 10, 2017
@shepmaster
Copy link
Member

Auto-assigning to...

r? @estebank

@nikomatsakis
Copy link
Contributor

Note the new policy on landing things for NLL -- basically, use the nll-master branch on my fork for now, and I will take care of the rest. @spastorino, I'm going to close this PR, can you re-open it against my repository?

Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking only at cf7fe00, LGTM. Please resubmit the PR against https://github.com/nikomatsakis/rust/tree/nll-master

@@ -16,7 +16,7 @@ use self::CombineMapType::*;
use super::{MiscVariable, RegionVariableOrigin, SubregionOrigin};
use super::unify_key;

use rustc_data_structures::indexed_vec::IndexVec;
use rustc_data_structures::indexed_vec::{IndexVec, Idx};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stray import?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's needed because methods of Idx trait are used

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see.

@spastorino
Copy link
Member Author

Done here nikomatsakis#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants