fn type_derefs_to_local(&self, span: Span, rcvr_ty: Ty<'tcx>, source: SelfSource<'_>) -> bool {
        fn is_local(ty: Ty<'_>) -> bool {
            match ty.kind {
                ty::Adt(def, _) => def.did.is_local(),
                ty::Foreign(did) => did.is_local(),

                ty::Dynamic(ref tr, ..) => {
                    tr.principal().map(|d| d.def_id().is_local()).unwrap_or(false)
                }

                ty::Param(_) => true,

                // Everything else (primitive types, etc.) is effectively
                // non-local (there are "edge" cases, e.g., `(LocalType,)`, but
                // the noise from these sort of types is usually just really
                // annoying, rather than any sort of help).
                _ => false,
            }
        }

        // This occurs for UFCS desugaring of `T::method`, where there is no
        // receiver expression for the method call, and thus no autoderef.
        if let SelfSource::QPath(_) = source {
            return is_local(self.resolve_vars_with_obligations(rcvr_ty));
        }

        self.autoderef(span, rcvr_ty).any(|(ty, _)| is_local(ty))
    }
/// Checks whether there is a local type somewhere in the chain of
/// autoderefs of `rcvr_ty`.
Checks whether there is a local type somewhere in the chain of
autoderefs of `rcvr_ty`.
Checks whether there is a local type somewhere in the chain of autoderefs of ` rcvr_ty ` .
fn type_derefs_to_local(&self, span: Span, rcvr_ty: Ty<'tcx>, source: SelfSource<'_>) -> bool {
        fn is_local(ty: Ty<'_>) -> bool {
            match ty.kind {
                ty::Adt(def, _) => def.did.is_local(),
                ty::Foreign(did) => did.is_local(),
                ty::Dynamic(ref tr, ..) => {
                    tr.principal().map(|d| d.def_id().is_local()).unwrap_or(false)
                }
                ty::Param(_) => true,
                // Everything else (primitive types, etc.) is effectively
                // non-local (there are "edge" cases, e.g., `(LocalType,)`, but
                // the noise from these sort of types is usually just really
                // annoying, rather than any sort of help).
                _ => false,
            }
        }
        // This occurs for UFCS desugaring of `T::method`, where there is no
        // receiver expression for the method call, and thus no autoderef.
        if let SelfSource::QPath(_) = source {
            return is_local(self.resolve_vars_with_obligations(rcvr_ty));
        }
        self.autoderef(span, rcvr_ty).any(|(ty, _)| is_local(ty))
    }
fn type_derefs_to_local ( & self , span : Span , rcvr_ty : Ty < ' tcx > , source : SelfSource < ' _ > ) -> bool { fn is_local ( ty : Ty < ' _ > ) -> bool { match ty . kind { ty :: Adt ( def , _ ) => def . did . is_local ( ) , ty :: Foreign ( did ) => did . is_local ( ) , ty :: Dynamic ( ref tr , .. ) => { tr . principal ( ) . map ( | d | d . def_id ( ) . is_local ( ) ) . unwrap_or ( false ) } ty :: Param ( _ ) => true , // Everything else (primitive types, etc.) is effectively // non-local (there are "edge" cases, e.g., `(LocalType,)`, but // the noise from these sort of types is usually just really // annoying, rather than any sort of help). _ => false , } } // This occurs for UFCS desugaring of `T::method`, where there is no // receiver expression for the method call, and thus no autoderef. if let SelfSource :: QPath ( _ ) = source { return is_local ( self . resolve_vars_with_obligations ( rcvr_ty ) ) ; } self . autoderef ( span , rcvr_ty ) . any ( | ( ty , _ ) | is_local ( ty ) ) }
Checks whether there is a local type somewhere in the chain of
autoderefs of `rcvr_ty`.
Checks whether there is a local type somewhere in the chain of autoderefs of ` rcvr_ty ` .
&self
span
Span
rcvr_ty
Ty<'tcx>
source
SelfSource<'_>
&self
span
Span
rcvr_ty
Ty<'tcx>
source
SelfSource<'_>