Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up🔬 refactor structure of `ty::Predicate` #48539
Comments
nikomatsakis
added
the
WG-compiler-traits
label
Feb 25, 2018
This comment has been minimized.
This comment has been minimized.
|
I think that the way to start here would be first to convert We would probably want to measure the performance of this, though. =) |
This comment has been minimized.
This comment has been minimized.
|
Given that this conflicts with what I'm already working on, I'd like to take this one. |
sgrif
self-assigned this
Mar 4, 2018
This comment has been minimized.
This comment has been minimized.
|
@sgrif Do you have any updates on this? |
XAMPPRocky
added
C-cleanup
T-lang
labels
May 14, 2018
This comment has been minimized.
This comment has been minimized.
Do you remember examples of places where this is a problem, to help guide the refactoring? |
This comment has been minimized.
This comment has been minimized.
|
This was discussed in a WG-traits meeting. @nikomatsakis didn't remember why he originally wanted this and it seems less relevant with chalk, making it a low priority. |
leodasvacas
added
the
P-low
label
Jun 4, 2018
This comment has been minimized.
This comment has been minimized.
|
I'm going to close this issue altogether, since it seems like we are going more the route of building up a "parallel structure" for Chalk purposes. |
nikomatsakis commentedFeb 25, 2018
The current
Predicateconservatively assumes that every variant may bind higher-ranked lifetimes:rust/src/librustc/ty/mod.rs
Lines 905 to 941 in 322d7f7
This forces us to account for higher-ranked binders in a lot more places in the code than we really should have to. It would be nice to restructure
Predicateto avoid that.In the past, I tried two approaches. In one, I separated out
PredicateintoPredicateandPredicateAtom. In the other, I introduced aPolyvariant intoPredicate. In the latter case, this made thePredicatetype recursive, so as an initial refactoring, I convertedPredicateto be a&'tcx PredicateKind, introducing indirection.It's been long enough that my memory is a bit dim, but I think that the second refactoring was done precisely because the first one turned out be rather intrusive. I am not sure just now which one I prefer, but I think we will want to do one of them sooner or later!
(NB. This will conflict with the work that @sgrif is doing in #48536, though the conflicts ought to be possible to resolve.)