Skip to content

Commit

Permalink
Combine Eq and Sub
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Feb 22, 2024
1 parent 865a168 commit 9c4a009
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 257 deletions.
12 changes: 5 additions & 7 deletions compiler/rustc_infer/src/infer/relate/combine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
//! [TypeRelation::a_is_expected], so when dealing with contravariance
//! this should be correctly updated.

use super::equate::Equate;
use super::glb::Glb;
use super::lub::Lub;
use super::sub::Sub;
use super::type_relating::TypeRelating;
use crate::infer::{DefineOpaqueTypes, InferCtxt, TypeTrace};
use crate::traits::{Obligation, PredicateObligations};
use rustc_middle::infer::canonical::OriginalQueryValues;
Expand All @@ -34,7 +33,6 @@ use rustc_middle::ty::error::{ExpectedFound, TypeError};
use rustc_middle::ty::relate::{RelateResult, TypeRelation};
use rustc_middle::ty::{self, InferConst, ToPredicate, Ty, TyCtxt, TypeVisitableExt};
use rustc_middle::ty::{IntType, UintType};
use rustc_middle::ty::{RelationDirection, TyVar};
use rustc_span::Span;

#[derive(Clone)]
Expand Down Expand Up @@ -304,12 +302,12 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
self.infcx.tcx
}

pub fn equate<'a>(&'a mut self, a_is_expected: bool) -> Equate<'a, 'infcx, 'tcx> {
Equate::new(self, a_is_expected)
pub fn equate<'a>(&'a mut self, a_is_expected: bool) -> TypeRelating<'a, 'infcx, 'tcx> {
TypeRelating::new(self, a_is_expected, ty::RelationDirection::Equate)
}

pub fn sub<'a>(&'a mut self, a_is_expected: bool) -> Sub<'a, 'infcx, 'tcx> {
Sub::new(self, a_is_expected)
pub fn sub<'a>(&'a mut self, a_is_expected: bool) -> TypeRelating<'a, 'infcx, 'tcx> {
TypeRelating::new(self, a_is_expected, ty::RelationDirection::Subtype)
}

pub fn lub<'a>(&'a mut self, a_is_expected: bool) -> Lub<'a, 'infcx, 'tcx> {
Expand Down
198 changes: 0 additions & 198 deletions compiler/rustc_infer/src/infer/relate/equate.rs

This file was deleted.

4 changes: 2 additions & 2 deletions compiler/rustc_infer/src/infer/relate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
//! (except for some relations used for diagnostics and heuristics in the compiler).

pub(super) mod combine;
mod equate;
mod generalize;
mod glb;
mod higher_ranked;
mod lattice;
mod lub;
mod sub;
pub mod nll;
mod type_relating;
Loading

0 comments on commit 9c4a009

Please sign in to comment.