Skip to main content

Module constraints

Module constraints 

Source
Expand description

Code to gather up constraints. Constraint construction and representation

The second pass over the HIR determines the set of constraints. We walk the set of items and, for each member, generate new constraints.

Re-exportsยง

use hir::def_id::DefId; ๐Ÿ”’
use hir::def_id::LocalDefId; ๐Ÿ”’
use rustc_hir as hir; ๐Ÿ”’
use rustc_hir::def::DefKind; ๐Ÿ”’
use rustc_middle::ty; ๐Ÿ”’
use rustc_middle::ty::GenericArgKind; ๐Ÿ”’
use rustc_middle::ty::GenericArgs; ๐Ÿ”’
use rustc_middle::ty::Ty; ๐Ÿ”’
use rustc_middle::ty::TyCtxt; ๐Ÿ”’
use rustc_span::bug; ๐Ÿ”’
use rustc_span::span_bug; ๐Ÿ”’
use tracing::debug; ๐Ÿ”’
use tracing::instrument; ๐Ÿ”’
use tracing::instrument; ๐Ÿ”’
use super::terms::VarianceTerm::*; ๐Ÿ”’
use super::terms::*; ๐Ÿ”’

Structsยง

Constraint ๐Ÿ”’
Declares that the variable decl_id appears in a location with variance variance.
ConstraintContext ๐Ÿ”’
CurrentItem ๐Ÿ”’
To build constraints, we visit one item (type, trait) at a time and look at its contents. So e.g., if we have

Functionsยง

add_constraints_from_crate ๐Ÿ”’