-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Various refactorings towards universe-based regions #45657
Various refactorings towards universe-based regions #45657
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
r? @arielb1 |
☔ The latest upstream changes (presumably #45072) made this pull request unmergeable. Please resolve the merge conflicts. |
Always using root environment for now.
This was all unused anyway.
The ena version has an improved interface. I suspect `librustc_data_structures` should start migrating out to crates.io in general.
This should not be needed: the new variable will be related to the old ones, so if they are constrained, so is the new variable; if they are not, and hence default to diverging, so will the new variable.
f74f4d9
to
edff811
Compare
// bug; it was introduced when we added the `eq_relations` | ||
// table, but it's hard to create rust code that triggers it.) | ||
// | ||
// We could tell the table to prefer lower vids, and then we would |
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.
We could also store the minimum vid of a node's childrenonce-children on each tree node and propagate that when we unify. This would allow us to find the lowest vid of a subtree by looking at the root node's vid, while being O(α(n))
to maintain.
☔ The latest upstream changes (presumably #44167) made this pull request unmergeable. Please resolve the merge conflicts. |
@@ -285,6 +285,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { | |||
let element_tys_iter = (0..max_len).map(|_| self.next_ty_var( |
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.
This looks ugly - would introduce a next_global_ty_var
function on fcx.
@@ -1250,6 +1332,17 @@ pub struct ParamEnv<'tcx> { | |||
/// want `Reveal::All` -- note that this is always paired with an | |||
/// empty environment. To get that, use `ParamEnv::reveal()`. | |||
pub reveal: traits::Reveal, | |||
|
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.
I find ParamEnv
containing a universe
rather unsatisfying - it doesn't fit in my mental model.
So @arielb1 and I had a chat on
I have to think over just how I want to adjust this PR. I think I will close it for the time being and mull things over. |
These are a variety of refactorings that I did on my lazy normalization. This code is not expected to change the behavior in any particular way, just pave the way for using universes more uniformly in place of the existing "leak check" approach (and, in turn, for normalization).
One of the notable things that this branch does is to adopt the unification table from the ena project in rust-lang-nursery, which is of course branched from the compiler sources.