Skip to main content

Module lattice

Module lattice 

Source
Expand description

Β§Lattice variables

Generic code for operating on lattices of inference variables that are characterized by an upper- and lower-bound.

The code is defined quite generically so that it can be applied both to type variables, which represent types being inferred, and fn variables, which represent function types being inferred. (It may eventually be applied to their types as well.) In some cases, the functions are also generic with respect to the operation on the lattice (GLB vs LUB).

Β§Note

Although all the functions are generic, for simplicity, comments in the source code generally refer to type variables and the LUB operation.

Re-exportsΒ§

use rustc_hir::def_id::DefId; πŸ”’
use rustc_middle::traits::solve::Goal; πŸ”’
use rustc_middle::ty::relate::combine::combine_ty_args; πŸ”’
use rustc_middle::ty::relate::combine::super_combine_consts; πŸ”’
use rustc_middle::ty::relate::combine::super_combine_tys; πŸ”’
use rustc_middle::ty::relate::Relate; πŸ”’
use rustc_middle::ty::relate::RelateResult; πŸ”’
use rustc_middle::ty::relate::TypeRelation; πŸ”’
use rustc_middle::ty; πŸ”’
use rustc_middle::ty::Ty; πŸ”’
use rustc_middle::ty::TyCtxt; πŸ”’
use rustc_middle::ty::TyVar; πŸ”’
use rustc_middle::ty::TypeVisitableExt; πŸ”’
use rustc_span::Span; πŸ”’
use rustc_span::span_bug; πŸ”’
use tracing::debug; πŸ”’
use tracing::instrument; πŸ”’
use tracing::instrument; πŸ”’
use super::combine::PredicateEmittingRelation; πŸ”’
use crate::infer::DefineOpaqueTypes; πŸ”’
use crate::infer::InferCtxt; πŸ”’
use crate::infer::SubregionOrigin; πŸ”’
use crate::infer::TypeTrace; πŸ”’
use crate::traits::Obligation; πŸ”’
use crate::traits::PredicateObligations; πŸ”’

StructsΒ§

LatticeOp πŸ”’
A greatest lower boundβ€œ (common subtype) or least upper bound (common supertype).

EnumsΒ§

LatticeOpKind πŸ”’