pub fn method_exists(&self,
                         method_name: ast::Ident,
                         self_ty: Ty<'tcx>,
                         call_expr_id: ast::NodeId,
                         allow_private: bool)
                         -> bool {
        let mode = probe::Mode::MethodCall;
        match self.probe_for_name(method_name.span, mode, method_name,
                                  IsSuggestion(false), self_ty, call_expr_id,
                                  ProbeScope::TraitsInScope) {
            Ok(..) => true,
            Err(NoMatch(..)) => false,
            Err(Ambiguity(..)) => true,
            Err(PrivateMatch(..)) => allow_private,
            Err(IllegalSizedBound(..)) => true,
            Err(BadReturnType) => {
                bug!("no return type expectations but got BadReturnType")
            }

        }
    }
/// Determines whether the type `self_ty` supports a method name `method_name` or not.
Determines whether the type `self_ty` supports a method name `method_name` or not.
Determines whether the type ` self_ty ` supports a method name ` method_name ` or not .
pub fn method_exists(&self,
                         method_name: ast::Ident,
                         self_ty: Ty<'tcx>,
                         call_expr_id: ast::NodeId,
                         allow_private: bool)
                         -> bool {
        let mode = probe::Mode::MethodCall;
        match self.probe_for_name(method_name.span, mode, method_name,
                                  IsSuggestion(false), self_ty, call_expr_id,
                                  ProbeScope::TraitsInScope) {
            Ok(..) => true,
            Err(NoMatch(..)) => false,
            Err(Ambiguity(..)) => true,
            Err(PrivateMatch(..)) => allow_private,
            Err(IllegalSizedBound(..)) => true,
            Err(BadReturnType) => {
                bug!("no return type expectations but got BadReturnType")
            }
        }
    }
pub fn method_exists ( & self , method_name : ast :: Ident , self_ty : Ty < ' tcx > , call_expr_id : ast :: NodeId , allow_private : bool ) -> bool { let mode = probe :: Mode :: MethodCall ; match self . probe_for_name ( method_name . span , mode , method_name , IsSuggestion ( false ) , self_ty , call_expr_id , ProbeScope :: TraitsInScope ) { Ok ( .. ) => true , Err ( NoMatch ( .. ) ) => false , Err ( Ambiguity ( .. ) ) => true , Err ( PrivateMatch ( .. ) ) => allow_private , Err ( IllegalSizedBound ( .. ) ) => true , Err ( BadReturnType ) => { bug ! ( " " ) } } }
Determines whether the type `self_ty` supports a method name `method_name` or not.
Determines whether the type ` self_ty ` supports a method name ` method_name ` or not .
&self
method_name
ast::Ident
self_ty
Ty<'tcx>
call_expr_id
ast::NodeId
allow_private
bool
&self
method_name
ast::Ident
self_ty
Ty<'tcx>
call_expr_id
ast::NodeId
allow_private
bool