rustc_hir_analysis::collect::predicates_of

Function const_conditions

Source
pub(super) fn const_conditions<'tcx>(
    tcx: TyCtxt<'tcx>,
    def_id: LocalDefId,
) -> ConstConditions<'tcx>
Expand description

Compute the conditions that need to hold for a conditionally-const item to be const. That is, compute the set of ~const where clauses for a given item.

This query also computes the ~const where clauses for associated types, which are not “const”, but which have item bounds which may be ~const. These must hold for the ~const item bound to hold.