pub fn substitute_projected<T>(
        &self,
        tcx: TyCtxt<'_, '_, 'tcx>,
        var_values: &CanonicalVarValues<'tcx>,
        projection_fn: impl FnOnce(&V) -> &T,
    ) -> T
    where
        T: TypeFoldable<'tcx>,
    {
        assert_eq!(self.variables.len(), var_values.len());
        let value = projection_fn(&self.value);
        substitute_value(tcx, var_values, value)
    }
/// Allows one to apply a substitute to some subset of
/// `self.value`. Invoke `projection_fn` with `self.value` to get
/// a value V that is expressed in terms of the same canonical
/// variables bound in `self` (usually this extracts from subset
/// of `self`). Apply the substitution `var_values` to this value
/// V, replacing each of the canonical variables.
Allows one to apply a substitute to some subset of
`self.value`.
Allows one to apply a substitute to some subset of ` self . value ` .
pub fn substitute_projected<T>(
        &self,
        tcx: TyCtxt<'_, '_, 'tcx>,
        var_values: &CanonicalVarValues<'tcx>,
        projection_fn: impl FnOnce(&V) -> &T,
    ) -> T
    where
        T: TypeFoldable<'tcx>,
    {
        assert_eq!(self.variables.len(), var_values.len());
        let value = projection_fn(&self.value);
        substitute_value(tcx, var_values, value)
    }
pub fn substitute_projected < T > ( & self , tcx : TyCtxt < ' _ , ' _ , ' tcx > , var_values : & CanonicalVarValues < ' tcx > , projection_fn : impl FnOnce ( & V ) -> & T , ) -> T where T : TypeFoldable < ' tcx > , { assert_eq ! ( self variables len ( ) var_values len ( ) ) ; let value = projection_fn ( & self . value ) ; substitute_value ( tcx , var_values , value ) }
Allows one to apply a substitute to some subset of
`self.value`.
Allows one to apply a substitute to some subset of ` self . value ` .
&self
tcx
TyCtxt<'_, '_, 'tcx>
var_values
&CanonicalVarValues<'tcx>
projection_fn
impl FnOnce(&V) -> &T