/// If `include_projections` is false, returns the list of parameters that are
/// constrained by the type `ty` - i.e. the value of each parameter in the list is
/// uniquely determined by `ty` (see RFC 447). If it is true, return the list
/// of parameters whose values are needed in order to constrain `ty` - these
/// differ, with the latter being a superset, in the presence of projections.
If `include_projections` is false, returns the list of parameters that are
constrained by the type `ty` - i.e. the value of each parameter in the list is
uniquely determined by `ty` . If it is true, return the list
of parameters whose values are needed in order to constrain `ty` - these
differ, with the latter being a superset, in the presence of projections.
If ` include_projections ` is false returns the list of parameters that are constrained by the type ` ty ` - i . e . the value of each parameter in the list is uniquely determined by ` ty ` . If it is true return the list of parameters whose values are needed in order to constrain ` ty ` - these differ with the latter being a superset in the presence of projections .
pub fn parameters_for_type<'tcx>(ty: Ty<'tcx>,
                                 include_projections: bool) -> Vec<Parameter> {
    let mut result = vec![];
    ty.maybe_walk(|t| match t.sty {
        ty::TyProjection(..) if !include_projections => {
            false // projections are not injective.
        }
        _ => {
            result.append(&mut parameters_for_type_shallow(t));
            // non-projection type constructors are injective.
            true
        }
    });
    result
}
pub fn parameters_for_type < ' tcx > ( ty : Ty < ' tcx > , include_projections : bool ) -> Vec < Parameter > { let mut result = vec ! [ ] ; ty . maybe_walk ( | t | match t . sty { ty :: TyProjection ( .. ) if ! include_projections => { false // projections are not injective. } _ => { result . append ( & mut parameters_for_type_shallow ( t ) ) ; // non-projection type constructors are injective. true } } ) ; result }
If `include_projections` is false, returns the list of parameters that are
constrained by the type `ty` - i.e.
If ` include_projections ` is false returns the list of parameters that are constrained by the type ` ty ` - i . e .
ty
Ty<'tcx>
include_projections
bool