Module rustc_infer::infer::relate
source · Expand description
This module contains the definitions of most TypeRelations in the type system
(except for some relations used for diagnostics and heuristics in the compiler).
Modules§
- combine 🔒There are four type combiners: Equate, Sub, Lub, and Glb. Each implements the trait TypeRelation and contains methods for combining two instances of various things and yielding a new instance. These combiner methods always yield a
Result<T>. To relate two types, you can useinfcx.at(cause, param_env)which then allows you to use the relevant methods of At. - equate 🔒
- glb 🔒Greatest lower bound. See
lattice. - Helper routines for higher-ranked things. See the
docmodule at the end of the file for details. - lattice 🔒Lattice variables
- lub 🔒Least upper bound. See
lattice. - This code is kind of an alternate way of doing subtyping, supertyping, and type equating, distinct from the
combine.rscode but very similar in its effect and design. Eventually the two ought to be merged. This code is intended for use in NLL and chalk. - sub 🔒