fn from_hir_only_param(ctx: &TyLoweringContext<'_>, type_ref: &TypeRef) -> Option<TypeParamId> {
        let path = match type_ref {
            TypeRef::Path(path) => path,
            _ => return None,
        };
        if path.type_anchor().is_some() {
            return None;
        }
        if path.segments().len() > 1 {
            return None;
        }
        let resolution =
            match ctx.resolver.resolve_path_in_type_ns(ctx.db.upcast(), path.mod_path()) {
                Some((it, None)) => it,
                _ => return None,
            };
        if let TypeNs::GenericParam(param_id) = resolution {
            Some(param_id)
        } else {
            None
        }
    }
/// This is only for `generic_predicates_for_param`, where we can't just
/// lower the self types of the predicates since that could lead to cycles.
/// So we just check here if the `type_ref` resolves to a generic param, and which.
This is only for `generic_predicates_for_param`, where we can't just
lower the self types of the predicates since that could lead to cycles.
So we just check here if the `type_ref` resolves to a generic param, and which.
This is only for ` generic_predicates_for_param ` where we can ' t just lower the self types of the predicates since that could lead to cycles . So we just check here if the ` type_ref ` resolves to a generic param and which .
fn from_hir_only_param(ctx: &TyLoweringContext<'_>, type_ref: &TypeRef) -> Option<TypeParamId> {
        let path = match type_ref {
            TypeRef::Path(path) => path,
            _ => return None,
        };
        if path.type_anchor().is_some() {
            return None;
        }
        if path.segments().len() > 1 {
            return None;
        }
        let resolution =
            match ctx.resolver.resolve_path_in_type_ns(ctx.db.upcast(), path.mod_path()) {
                Some((it, None)) => it,
                _ => return None,
            };
        if let TypeNs::GenericParam(param_id) = resolution {
            Some(param_id)
        } else {
            None
        }
    }
fn from_hir_only_param ( ctx : & TyLoweringContext < ' _ > , type_ref : & TypeRef ) -> Option < TypeParamId > { let path = match type_ref { TypeRef :: Path ( path ) => path , _ => return None , } ; if path . type_anchor ( ) . is_some ( ) { return None ; } if path . segments ( ) . len ( ) > 1 { return None ; } let resolution = match ctx . resolver . resolve_path_in_type_ns ( ctx . db . upcast ( ) , path . mod_path ( ) ) { Some ( ( it , None ) ) => it , _ => return None , } ; if let TypeNs :: GenericParam ( param_id ) = resolution { Some ( param_id ) } else { None } }
This is only for `generic_predicates_for_param`, where we can't just
lower the self types of the predicates since that could lead to cycles.
This is only for ` generic_predicates_for_param ` where we can ' t just lower the self types of the predicates since that could lead to cycles .
ctx
&TyLoweringContext<'_>
type_ref
&TypeRef