Skip to content

Commit 7067e4a

Browse files
committed
Auto merge of #131191 - nnethercote:lattice_op, r=lcnr
Merge `glb` and `lub` modules Tons of code is duplicated across them, and it's easy to factor that out. r? `@lcnr`
2 parents e1e3cac + ee227de commit 7067e4a

5 files changed

Lines changed: 231 additions & 403 deletions

File tree

‎compiler/rustc_infer/src/infer/relate/combine.rs‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! There are four type combiners: [TypeRelating], [Lub], and [Glb],
1+
//! There are four type combiners: [TypeRelating], `Lub`, and `Glb`,
22
//! and `NllTypeRelating` in rustc_borrowck, which is only used for NLL.
33
//!
44
//! Each implements the trait [TypeRelation] and contains methods for
@@ -26,8 +26,7 @@ use rustc_middle::ty::{self, InferConst, IntType, Ty, TyCtxt, TypeVisitableExt,
2626
pubuse rustc_next_trait_solver::relate::combine::*;
2727
use tracing::debug;
2828

29-
usesuper::glb::Glb;
30-
usesuper::lub::Lub;
29+
usesuper::lattice::{LatticeOp,LatticeOpKind};
3130
usesuper::type_relating::TypeRelating;
3231
usesuper::{RelateResult,StructurallyRelateAliases};
3332
usecrate::infer::{DefineOpaqueTypes,InferCtxt,TypeTrace, relate};
@@ -303,12 +302,12 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
303302
TypeRelating::new(self,StructurallyRelateAliases::No, ty::Contravariant)
304303
}
305304

306-
pubfnlub<'a>(&'amutself) -> Lub<'a,'infcx,'tcx>{
307-
Lub::new(self)
305+
pub(crate)fnlub<'a>(&'amutself) -> LatticeOp<'a,'infcx,'tcx>{
306+
LatticeOp::new(self,LatticeOpKind::Lub)
308307
}
309308

310-
pubfnglb<'a>(&'amutself) -> Glb<'a,'infcx,'tcx>{
311-
Glb::new(self)
309+
pub(crate)fnglb<'a>(&'amutself) -> LatticeOp<'a,'infcx,'tcx>{
310+
LatticeOp::new(self,LatticeOpKind::Glb)
312311
}
313312

314313
pubfnregister_obligations(

‎compiler/rustc_infer/src/infer/relate/glb.rs‎

Lines changed: 0 additions & 159 deletions
This file was deleted.

0 commit comments

Comments
 (0)