}
/// Returns the set of parameters constrained by the impl header.
-pub fn parameters_for_impl<'tcx>(impl_self_ty: Ty<'tcx>,
- impl_trait_ref: Option<ty::TraitRef<'tcx>>)
- -> FxHashSet<Parameter>
-{
+pub fn parameters_for_impl<'tcx>(
+ impl_self_ty: Ty<'tcx>,
+ impl_trait_ref: Option<ty::TraitRef<'tcx>>,
+) -> FxHashSet<Parameter> {
let vec = match impl_trait_ref {
Some(tr) => parameters_for(&tr, false),
None => parameters_for(&impl_self_ty, false),
/// uniquely determined by `t` (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.
-pub fn parameters_for<'tcx, T>(t: &T,
- include_nonconstraining: bool)
- -> Vec<Parameter>
- where T: TypeFoldable<'tcx>
-{
-
+pub fn parameters_for<'tcx>(
+ t: &impl TypeFoldable<'tcx>,
+ include_nonconstraining: bool,
+) -> Vec<Parameter> {
let mut collector = ParameterCollector {
parameters: vec![],
include_nonconstraining,
impl<'tcx> TypeVisitor<'tcx> for ParameterCollector {
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {
- match t.sty {
+ match t.kind {
ty::Projection(..) | ty::Opaque(..) if !self.include_nonconstraining => {
// projections are not injective
return false;