fn check_path(&mut self, span: Span, def: Def, path: &Path) {
        debug!("checking path");
        match def {
            DefStaticMethod(method_id, _, _) => {
                debug!("found static method def, checking it");
                self.check_method_common(span,
                                         method_id,
                                         &path.segments.last().identifier)
            }
            DefFn(def_id, _) => {
                if def_id.crate == LOCAL_CRATE {
                    if self.local_item_is_private(span, def_id.node) &&
                            !self.privileged_items.iter().any(|x| x == &def_id.node) {
                        self.tcx.sess.span_err(span,
                                          fmt!("function `%s` is private",
                                               token::ident_to_str(
                                                &path.segments
                                                     .last()
                                                     .identifier)));
                    }
                } else if csearch::get_item_visibility(self.tcx.sess.cstore,
                                                       def_id) != public {
                    self.tcx.sess.span_err(span,
                                      fmt!("function `%s` is private",
                                           token::ident_to_str(
                                                &path.segments
                                                     .last()
                                                     .identifier)));
                }
            }
            _ => {}
        }
    }
// Checks that a private path is in scope.
Checks that a private path is in scope.
Checks that a private path is in scope .
fn check_path(&mut self, span: Span, def: Def, path: &Path) {
        debug!("checking path");
        match def {
            DefStaticMethod(method_id, _, _) => {
                debug!("found static method def, checking it");
                self.check_method_common(span,
                                         method_id,
                                         &path.segments.last().identifier)
            }
            DefFn(def_id, _) => {
                if def_id.crate == LOCAL_CRATE {
                    if self.local_item_is_private(span, def_id.node) &&
                            !self.privileged_items.iter().any(|x| x == &def_id.node) {
                        self.tcx.sess.span_err(span,
                                          fmt!("function `%s` is private",
                                               token::ident_to_str(
                                                &path.segments
                                                     .last()
                                                     .identifier)));
                    }
                } else if csearch::get_item_visibility(self.tcx.sess.cstore,
                                                       def_id) != public {
                    self.tcx.sess.span_err(span,
                                      fmt!("function `%s` is private",
                                           token::ident_to_str(
                                                &path.segments
                                                     .last()
                                                     .identifier)));
                }
            }
            _ => {}
        }
    }
fn check_path ( & mut self , span : Span , def : Def , path : & Path ) { debug ! ( " " ) ; match def { DefStaticMethod ( method_id , _ , _ ) => { debug ! ( " " ) ; self . check_method_common ( span , method_id , & path . segments . last ( ) . identifier ) } DefFn ( def_id , _ ) => { if def_id . crate == LOCAL_CRATE { if self . local_item_is_private ( span , def_id . node ) && ! self . privileged_items . iter ( ) . any ( | x | x == & def_id . node ) { self . tcx . sess . span_err ( span , fmt ! ( " " token ident_to_str ( path segments last ( ) identifier ) ) ) ; } } else if csearch :: get_item_visibility ( self . tcx . sess . cstore , def_id ) != public { self . tcx . sess . span_err ( span , fmt ! ( " " token ident_to_str ( path segments last ( ) identifier ) ) ) ; } } _ => { } } }
Checks that a private path is in scope.
Checks that a private path is in scope .
&mut self
span
Span
def
Def
path
&Path
&mut self
span
Span
def
Def
path
&Path