Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
5696dd7 to
3365481
Compare
| } | ||
| } | ||
|
|
||
| impl<I: Interner> PredicateProxy<I> for Predicate<I> { |
There was a problem hiding this comment.
what's that trait?
There was a problem hiding this comment.
it's an existing trait for handling predicates and clauses during folding and visiting
but we may no longer need it 👍🏻
There was a problem hiding this comment.
PredicateProxy is still used by folding and visiting to avoid depending on the concrete predicate representation
I removed the redundant inherent::Predicate trait but kept PredicateProxy since those hooks still need it
| needs_triple::<T>(); | ||
| } | ||
|
|
||
| fn main() {} |
There was a problem hiding this comment.
? 🤔 why added in this PR
| } | ||
| } | ||
|
|
||
| impl<'a, 'tcx> rustc_middle::ty::PredicateDecoder<TyCtxt<'tcx>> |
There was a problem hiding this comment.
why does this have to be a separate trait?
There was a problem hiding this comment.
it's the existing InternerDecoder
I just extended it to preserve rustc's shorthand decoding
There was a problem hiding this comment.
if there are parts you can uplift individually, can you split this into multiple PRs, e.g. the BoundVarIndexShifter
also, please explain in the PR description the changes and traits you needed to do the uplifting, skimming over the PR, it does otherwise look good.
I do weakly dislike the uses of crate:: in rustc_type_ir, could you use explicit use statements instead.
Also, I think there should be some Predicate trait in inherent you should remove
3365481 to
d8ebe7f
Compare
This comment has been minimized.
This comment has been minimized.
…ifter, r=lcnr move `BoundVarReplacer` into rustc_type_ir move `BoundVarReplacer` into `rustc_type_ir` and use it from `TyCtxt::shift_bound_var_indices` this is split out of rust-lang#163985
…ifter, r=lcnr move `BoundVarReplacer` into rustc_type_ir move `BoundVarReplacer` into `rustc_type_ir` and use it from `TyCtxt::shift_bound_var_indices` this is split out of rust-lang#163985
This comment has been minimized.
This comment has been minimized.
d26083a to
992c0c7
Compare
|
r? @folkertdev rustbot has assigned @folkertdev. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? lcnr |
This comment has been minimized.
This comment has been minimized.
| #[inline(never)] | ||
| fn intern_predicate(&self, kind: Binder<'tcx, PredicateKind<'tcx>>) -> Predicate<'tcx> { | ||
| Predicate(Interned::new_unchecked( | ||
| rustc_type_ir::predicates::Predicate(Interned::new_unchecked( |
There was a problem hiding this comment.
use ty::Predicate or sth instead
| pub struct Predicate<'tcx>( | ||
| pub(super) Interned<'tcx, WithCachedTypeInfo<ty::Binder<'tcx, PredicateKind<'tcx>>>>, | ||
| ); | ||
| /// An interned statement the trait solver can prove. |
There was a problem hiding this comment.
i'd keep it consistent with the other type aliases and not have any comments
| // Preserve rustc's existing diagnostic formatting while the concrete | ||
| // predicate wrappers are being migrated into rustc_type_ir. |
There was a problem hiding this comment.
confusing comment once this PR is merged
| .into_iter() | ||
| .chain(requirements.into_iter().map(|clause| Goal::new(cx, param_env, clause))) | ||
| .chain( | ||
| requirements.into_iter().map(|clause| Goal::new(cx, param_env, clause.as_predicate())), |
There was a problem hiding this comment.
hmm? why
| let cx = self.cx(); | ||
| let clauses = reqs | ||
| .into_iter() | ||
| .filter_map(|goal| goal.predicate.as_clause().map(|clause| clause.kind().upcast(cx))); |
There was a problem hiding this comment.
hmm, that feels off. why is this change required?
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
992c0c7 to
8e923fc
Compare
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Amirhossein Akhlaghpour <[email protected]>
Signed-off-by: Amirhossein Akhlaghpour <[email protected]>
Signed-off-by: Amirhossein Akhlaghpour <[email protected]>
Signed-off-by: Amirhossein Akhlaghpour <[email protected]>
Signed-off-by: Amirhossein Akhlaghpour <[email protected]>
Signed-off-by: Amirhossein Akhlaghpour <[email protected]>
Signed-off-by: Amirhossein Akhlaghpour <[email protected]>
Signed-off-by: Amirhossein Akhlaghpour <[email protected]>
Signed-off-by: Amirhossein Akhlaghpour <[email protected]>
Signed-off-by: Amirhossein Akhlaghpour <[email protected]>
Signed-off-by: Amirhossein Akhlaghpour <[email protected]>
Signed-off-by: Amirhossein Akhlaghpour <[email protected]>
8e923fc to
dbbb13b
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready |
View all comments
moves
PredicateandClauseintorustc_type_irremoving the need for their associated types andinherenttraitsmost of the changes are moving existing implementations and making them generic over the interner
a few things worth explaining:
PredicateProxystays because folding and visiting still use it for both predicates and clausesPredicateEncoderand the extension toInternerDecoderpreserve the existing shorthand encodingrustc_middleto retain the existingshort_stringbehaviorUpcastFromimpls would overlapsplit out
BoundVarIndexShifterinto #164040