-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Separate clauses and goals from the Predicate type #107250
Comments
@rustbot claim |
@rustbot claim |
|
@GentBinaku are you still actively working on this? |
@rustbot claim |
…compiler-errors Make `Bound::predicates` use `Clause` Part of rust-lang#107250 `Bound::predicates` returns an iterator over `Binder<_, Clause>` instead of `Predicate`. I tried updating `explicit_predicates_of` as well, but it seems that it needs a lot more change than I thought. Will do it in a separate PR instead.
…compiler-errors Make `Bound::predicates` use `Clause` Part of rust-lang#107250 `Bound::predicates` returns an iterator over `Binder<_, Clause>` instead of `Predicate`. I tried updating `explicit_predicates_of` as well, but it seems that it needs a lot more change than I thought. Will do it in a separate PR instead.
…compiler-errors Make `Bound::predicates` use `Clause` Part of rust-lang#107250 `Bound::predicates` returns an iterator over `Binder<_, Clause>` instead of `Predicate`. I tried updating `explicit_predicates_of` as well, but it seems that it needs a lot more change than I thought. Will do it in a separate PR instead.
@rustbot claim |
I think I'm a little bit unsure about the task.
What count as an unneeded impl? Some impls can be removed without error, but theres one gray area I'm not sure. That is the impl is not there to satisfy a trait bound but just a helper function. Does this count the impl needed or not? We can just inline the impl body? |
…unused-to-predicate, r=oli-obk clean up unneeded `ToPredicate` impls Part of rust-lang#107250. Removed all totally unused impls. And inlined two impls not need to satisify trait bound. r? `@oli-obk`
Rollup merge of rust-lang#115566 - zirconium-n:issue-107250-clean-up-unused-to-predicate, r=oli-obk clean up unneeded `ToPredicate` impls Part of rust-lang#107250. Removed all totally unused impls. And inlined two impls not need to satisify trait bound. r? `@oli-obk`
Split up the
PredicateKind
type intoGoal
andClauses
similar (or exactly :D) like what chalk does. The TLDR is that ParamEnv only contains a small set ofPrecicateKind
variants and we want to encode this in the type system by only returningClause
s from it.This projection has been accepted as an MCP: rust-lang/compiler-team#531
Implementation steps
Trait
,TypeOutlives
,RegionOutlives
andProjection
intoClause
enum: #104846inferred_outlives_crate
returns predicates, but they are always only TypeOutlives or RegionOutlivesty::Predicate
and build the predicates at the caller site ofinferred_outlives_of
explicit_predicates_of
is gonna be a bit more involvedgather_explicit_predicates_of
and convert at the caller sitesBounds::predicates
should return an iterator over Clauses (MakeBound::predicates
useClause
#112734)Follow-up work after #112938:
TypeFoldable<TyCtxt<'tcx>> for ty::Clause<'tcx>
implementation less weird:rust/compiler/rustc_middle/src/ty/structural_impls.rs
Line 672 in 2efe091
pred
andpredicates
toclause
if they're actually clauses around the codebaseToPredicate
impls are acutally still needed, or prune them if they're notleave a comment when you start working on one of these steps so that no one else duplicates work.
The text was updated successfully, but these errors were encountered: