diff options
| author | Michael Goulet <michael@errs.io> | 2023-03-21 21:50:16 +0000 | 
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-03-23 05:56:27 +0000 | 
| commit | 5dc3fd7c05010654b4d80b87eac8c937e4808607 (patch) | |
| tree | 5277cbdbb1c42ecfaac6cc1e1a0dd01176f95d30 /compiler/rustc_infer/src/infer/combine.rs | |
| parent | 439292bc7913399e406d9bb7e8da0f70c6317c6e (diff) | |
| download | rust-5dc3fd7c05010654b4d80b87eac8c937e4808607.tar.gz rust-5dc3fd7c05010654b4d80b87eac8c937e4808607.zip | |
Include relation direction in AliasEq predicate
Diffstat (limited to 'compiler/rustc_infer/src/infer/combine.rs')
| -rw-r--r-- | compiler/rustc_infer/src/infer/combine.rs | 8 | 
1 files changed, 5 insertions, 3 deletions
| diff --git a/compiler/rustc_infer/src/infer/combine.rs b/compiler/rustc_infer/src/infer/combine.rs index 4503af03ca3..c82438f05e1 100644 --- a/compiler/rustc_infer/src/infer/combine.rs +++ b/compiler/rustc_infer/src/infer/combine.rs @@ -842,7 +842,7 @@ pub trait ObligationEmittingRelation<'tcx>: TypeRelation<'tcx> { let (a, b) = if self.a_is_expected() { (a, b) } else { (b, a) }; self.register_predicates([ty::Binder::dummy(if self.tcx().trait_solver_next() { - ty::PredicateKind::AliasEq(a.into(), b.into()) + ty::PredicateKind::AliasEq(a.into(), b.into(), ty::AliasRelationDirection::Equate) } else { ty::PredicateKind::ConstEquate(a, b) })]); @@ -852,13 +852,15 @@ pub trait ObligationEmittingRelation<'tcx>: TypeRelation<'tcx> { /// /// If they aren't equal then the relation doesn't hold. fn register_type_equate_obligation(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) { - let (a, b) = if self.a_is_expected() { (a, b) } else { (b, a) }; - self.register_predicates([ty::Binder::dummy(ty::PredicateKind::AliasEq( a.into(), b.into(), + self.alias_relate_direction(), ))]); } + + /// Relation direction emitted for `AliasEq` predicates + fn alias_relate_direction(&self) -> ty::AliasRelationDirection; } fn int_unification_error<'tcx>( | 
