|
1 |
| -//! There are four type combiners: [TypeRelating], [Lub], and [Glb], |
| 1 | +//! There are four type combiners: [TypeRelating], `Lub`, and `Glb`, |
2 | 2 | //! and `NllTypeRelating` in rustc_borrowck, which is only used for NLL.
|
3 | 3 | //!
|
4 | 4 | //! Each implements the trait [TypeRelation] and contains methods for
|
@@ -26,8 +26,7 @@ use rustc_middle::ty::{self, InferConst, IntType, Ty, TyCtxt, TypeVisitableExt,
|
26 | 26 | pub use rustc_next_trait_solver::relate::combine::*;
|
27 | 27 | use tracing::debug;
|
28 | 28 |
|
29 |
| -use super::glb::Glb; |
30 |
| -use super::lub::Lub; |
| 29 | +use super::lattice::{LatticeOp, LatticeOpKind}; |
31 | 30 | use super::type_relating::TypeRelating;
|
32 | 31 | use super::{RelateResult, StructurallyRelateAliases};
|
33 | 32 | use crate::infer::{DefineOpaqueTypes, InferCtxt, TypeTrace, relate};
|
@@ -298,12 +297,16 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
|
298 | 297 | TypeRelating::new(self, StructurallyRelateAliases::No, ty::Contravariant)
|
299 | 298 | }
|
300 | 299 |
|
301 |
| - pub fn lub<'a>(&'a mut self) -> Lub<'a, 'infcx, 'tcx> { |
302 |
| - Lub::new(self) |
| 300 | + pub(crate) fn lattice_op<'a>(&'a mut self, kind: LatticeOpKind) -> LatticeOp<'a, 'infcx, 'tcx> { |
| 301 | + LatticeOp::new(kind, self) |
303 | 302 | }
|
304 | 303 |
|
305 |
| - pub fn glb<'a>(&'a mut self) -> Glb<'a, 'infcx, 'tcx> { |
306 |
| - Glb::new(self) |
| 304 | + pub(crate) fn lub<'a>(&'a mut self) -> LatticeOp<'a, 'infcx, 'tcx> { |
| 305 | + LatticeOp::new(LatticeOpKind::Lub, self) |
| 306 | + } |
| 307 | + |
| 308 | + pub(crate) fn glb<'a>(&'a mut self) -> LatticeOp<'a, 'infcx, 'tcx> { |
| 309 | + LatticeOp::new(LatticeOpKind::Glb, self) |
307 | 310 | }
|
308 | 311 |
|
309 | 312 | pub fn register_obligations(
|
|
0 commit comments