pub fn lookup_method(&self,
                         span: Span,
                         method_name: ast::Name,
                         self_ty: ty::Ty<'tcx>,
                         supplied_method_types: Vec<ty::Ty<'tcx>>,
                         call_expr: &'gcx hir::Expr,
                         self_expr: &'gcx hir::Expr)
                         -> Result<ty::MethodCallee<'tcx>, MethodError<'tcx>> {
        debug!("lookup(method_name={}, self_ty={:?}, call_expr={:?}, self_expr={:?})",
               method_name,
               self_ty,
               call_expr,
               self_expr);

        let mode = probe::Mode::MethodCall;
        let self_ty = self.resolve_type_vars_if_possible(&self_ty);
        let pick = self.probe_for_name(span, mode, method_name, IsSuggestion(false),
                                       self_ty, call_expr.id)?;

        if let Some(import_id) = pick.import_id {
            let import_def_id = self.tcx.hir.local_def_id(import_id);
            debug!("used_trait_import: {:?}", import_def_id);
            self.tables.borrow_mut().used_trait_imports.insert(import_def_id);
        }

        self.tcx.check_stability(pick.item.def_id, call_expr.id, span);

        Ok(self.confirm_method(span,
                               self_expr,
                               call_expr,
                               self_ty,
                               pick,
                               supplied_method_types))
    }
/// Performs method lookup. If lookup is successful, it will return the callee
/// and store an appropriate adjustment for the self-expr. In some cases it may
/// report an error (e.g., invoking the `drop` method).
///
/// # Arguments
///
/// Given a method call like `foo.bar::<T1,...Tn>(...)`:
///
/// * `fcx`:                   the surrounding `FnCtxt` (!)
/// * `span`:                  the span for the method call
/// * `method_name`:           the name of the method being called (`bar`)
/// * `self_ty`:               the (unadjusted) type of the self expression (`foo`)
/// * `supplied_method_types`: the explicit method type parameters, if any (`T1..Tn`)
/// * `self_expr`:             the self expression (`foo`)
Performs method lookup. If lookup is successful, it will return the callee
and store an appropriate adjustment for the self-expr. In some cases it may
report an error .
Performs method lookup . If lookup is successful it will return the callee and store an appropriate adjustment for the self - expr . In some cases it may report an error .
pub fn lookup_method(&self,
                         span: Span,
                         method_name: ast::Name,
                         self_ty: ty::Ty<'tcx>,
                         supplied_method_types: Vec<ty::Ty<'tcx>>,
                         call_expr: &'gcx hir::Expr,
                         self_expr: &'gcx hir::Expr)
                         -> Result<ty::MethodCallee<'tcx>, MethodError<'tcx>> {
        debug!("lookup(method_name={}, self_ty={:?}, call_expr={:?}, self_expr={:?})",
               method_name,
               self_ty,
               call_expr,
               self_expr);
        let mode = probe::Mode::MethodCall;
        let self_ty = self.resolve_type_vars_if_possible(&self_ty);
        let pick = self.probe_for_name(span, mode, method_name, IsSuggestion(false),
                                       self_ty, call_expr.id)?;
        if let Some(import_id) = pick.import_id {
            let import_def_id = self.tcx.hir.local_def_id(import_id);
            debug!("used_trait_import: {:?}", import_def_id);
            self.tables.borrow_mut().used_trait_imports.insert(import_def_id);
        }
        self.tcx.check_stability(pick.item.def_id, call_expr.id, span);
        Ok(self.confirm_method(span,
                               self_expr,
                               call_expr,
                               self_ty,
                               pick,
                               supplied_method_types))
    }
pub fn lookup_method ( & self , span : Span , method_name : ast :: Name , self_ty : ty :: Ty < ' tcx > , supplied_method_types : Vec < ty :: Ty < ' tcx > > , call_expr : & ' gcx hir :: Expr , self_expr : & ' gcx hir :: Expr ) -> Result < ty :: MethodCallee < ' tcx > , MethodError < ' tcx > > { debug ! ( " " method_name self_ty call_expr self_expr ) ; let mode = probe :: Mode :: MethodCall ; let self_ty = self . resolve_type_vars_if_possible ( & self_ty ) ; let pick = self . probe_for_name ( span , mode , method_name , IsSuggestion ( false ) , self_ty , call_expr . id ) ? ; if let Some ( import_id ) = pick . import_id { let import_def_id = self . tcx . hir . local_def_id ( import_id ) ; debug ! ( " " import_def_id ) ; self . tables . borrow_mut ( ) . used_trait_imports . insert ( import_def_id ) ; } self . tcx . check_stability ( pick . item . def_id , call_expr . id , span ) ; Ok ( self . confirm_method ( span , self_expr , call_expr , self_ty , pick , supplied_method_types ) ) }
Performs method lookup.
Performs method lookup .
&self
span
Span
method_name
ast::Name
self_ty
ty::Ty<'tcx>
supplied_method_types
Vec<ty::Ty<'tcx>>
call_expr
&'gcx hir::Expr
self_expr
&'gcx hir::Expr
&self
span
Span
method_name
ast::Name
self_ty
ty::Ty<'tcx>
supplied_method_types
Vec<ty::Ty<'tcx>>
call_expr
&'gcx hir::Expr
self_expr
&'gcx hir::Expr