-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Conversation
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.
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.
Auto-assigning to... r? @estebank |
Note the new policy on landing things for NLL -- basically, use the |
There was a problem hiding this 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}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stray import?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see.
Done here nikomatsakis#11 |
THIS SHOULD BE MERGED AFTER #45825 and probably after rebasing and force pushing :)
/cc @nikomatsakis