rustc_trait_selection::traits

Function evaluate_const

Source
pub fn evaluate_const<'tcx>(
    infcx: &InferCtxt<'tcx>,
    ct: Const<'tcx>,
    param_env: ParamEnv<'tcx>,
) -> Const<'tcx>
Expand description

Evaluates a type system constant returning a ConstKind::Error in cases where CTFE failed and returning the passed in constant if it was not fully concrete (i.e. depended on generic parameters or inference variables)

You should not call this function unless you are implementing normalization itself. Prefer to use normalize_erasing_regions or the normalize functions on ObligationCtxt/FnCtxt/InferCtxt.