fn check_method_common(&mut self, span: Span, method_id: DefId, name: &Ident) {
        // If the method is a default method, we need to use the def_id of
        // the default implementation.
        // Having to do this this is really unfortunate.
        let method_id = ty::method(self.tcx, method_id).provided_source
            .unwrap_or_default(method_id);

        if method_id.crate == LOCAL_CRATE {
            let is_private = self.method_is_private(span, method_id.node);
            let container_id = ty::method(self.tcx, method_id).container_id();
            if is_private &&
                    (container_id.crate != LOCAL_CRATE ||
                     !self.privileged_items.iter().any(|x| x == &(container_id.node))) {
                self.tcx.sess.span_err(span,
                                  fmt!("method `%s` is private",
                                       token::ident_to_str(name)));
            }
        } else {
            let visibility =
                csearch::get_item_visibility(self.tcx.sess.cstore, method_id);
            if visibility != public {
                self.tcx.sess.span_err(span,
                                  fmt!("method `%s` is private",
                                       token::ident_to_str(name)));
            }
        }
    }
// Given the ID of a method, checks to ensure it's in scope.
Given the ID of a method, checks to ensure it's in scope.
Given the ID of a method checks to ensure it ' s in scope .
fn check_method_common(&mut self, span: Span, method_id: DefId, name: &Ident) {
        // If the method is a default method, we need to use the def_id of
        // the default implementation.
        // Having to do this this is really unfortunate.
        let method_id = ty::method(self.tcx, method_id).provided_source
            .unwrap_or_default(method_id);
        if method_id.crate == LOCAL_CRATE {
            let is_private = self.method_is_private(span, method_id.node);
            let container_id = ty::method(self.tcx, method_id).container_id();
            if is_private &&
                    (container_id.crate != LOCAL_CRATE ||
                     !self.privileged_items.iter().any(|x| x == &(container_id.node))) {
                self.tcx.sess.span_err(span,
                                  fmt!("method `%s` is private",
                                       token::ident_to_str(name)));
            }
        } else {
            let visibility =
                csearch::get_item_visibility(self.tcx.sess.cstore, method_id);
            if visibility != public {
                self.tcx.sess.span_err(span,
                                  fmt!("method `%s` is private",
                                       token::ident_to_str(name)));
            }
        }
    }
fn check_method_common ( & mut self , span : Span , method_id : DefId , name : & Ident ) { // If the method is a default method, we need to use the def_id of // the default implementation. // Having to do this this is really unfortunate. let method_id = ty :: method ( self . tcx , method_id ) . provided_source . unwrap_or_default ( method_id ) ; if method_id . crate == LOCAL_CRATE { let is_private = self . method_is_private ( span , method_id . node ) ; let container_id = ty :: method ( self . tcx , method_id ) . container_id ( ) ; if is_private && ( container_id . crate != LOCAL_CRATE || ! self . privileged_items . iter ( ) . any ( | x | x == & ( container_id . node ) ) ) { self . tcx . sess . span_err ( span , fmt ! ( " " token ident_to_str ( name ) ) ) ; } } else { let visibility = csearch :: get_item_visibility ( self . tcx . sess . cstore , method_id ) ; if visibility != public { self . tcx . sess . span_err ( span , fmt ! ( " " token ident_to_str ( name ) ) ) ; } } }
Given the ID of a method, checks to ensure it's in scope.
Given the ID of a method checks to ensure it ' s in scope .
&mut self
span
Span
method_id
DefId
name
&Ident
&mut self
span
Span
method_id
DefId
name
&Ident