You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nikomatsakis opened this issue
Feb 25, 2018
· 6 comments
Assignees
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.P-lowLow priorityT-langRelevant to the language team, which will review and decide on the PR/issue.WG-traitsWorking group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804
/// Constant initializer must evaluate successfully.
ConstEvaluatable(DefId,&'tcx Substs<'tcx>),
}
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 Predicate to avoid that.
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.)
The text was updated successfully, but these errors were encountered:
nikomatsakis
added
the
WG-traits
Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804
label
Feb 25, 2018
I think that the way to start here would be first to convert Predicate to be interned, so that it can have a recursive structure. The starting point would be to cherry-pick these commits from my repo:
XAMPPRocky
added
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
labels
May 14, 2018
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.
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.P-lowLow priorityT-langRelevant to the language team, which will review and decide on the PR/issue.WG-traitsWorking group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804
The current
Predicate
conservatively 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
Predicate
to avoid that.In the past, I tried two approaches. In one, I separated out
Predicate
intoPredicate
andPredicateAtom
. In the other, I introduced aPoly
variant intoPredicate
. In the latter case, this made thePredicate
type recursive, so as an initial refactoring, I convertedPredicate
to 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.)
The text was updated successfully, but these errors were encountered: