fn annotate<F>(&mut self, id: NodeId, use_parent: bool,
                   attrs: &Vec<Attribute>, item_sp: Span, f: F) where
        F: FnOnce(&mut Annotator),
    {
        match attr::find_stability(self.sess.diagnostic(), attrs.as_slice(), item_sp) {
            Some(stab) => {
                self.index.local.insert(id, stab.clone());

                // Don't inherit #[stable(feature = "rust1", since = "1.0.0")]
                if stab.level != attr::Stable {
                    let parent = replace(&mut self.parent, Some(stab));
                    f(self);
                    self.parent = parent;
                } else {
                    f(self);
                }
            }
            None => {
                if use_parent {
                    self.parent.clone().map(|stab| self.index.local.insert(id, stab));
                }
                f(self);
            }
        }
    }
// Determine the stability for a node based on its attributes and inherited
// stability. The stability is recorded in the index and used as the parent.
Determine the stability for a node based on its attributes and inherited
stability. The stability is recorded in the index and used as the parent.
Determine the stability for a node based on its attributes and inherited stability . The stability is recorded in the index and used as the parent .
fn annotate<F>(&mut self, id: NodeId, use_parent: bool,
                   attrs: &Vec<Attribute>, item_sp: Span, f: F) where
        F: FnOnce(&mut Annotator),
    {
        match attr::find_stability(self.sess.diagnostic(), attrs.as_slice(), item_sp) {
            Some(stab) => {
                self.index.local.insert(id, stab.clone());
                // Don't inherit #[stable(feature = "rust1", since = "1.0.0")]
                if stab.level != attr::Stable {
                    let parent = replace(&mut self.parent, Some(stab));
                    f(self);
                    self.parent = parent;
                } else {
                    f(self);
                }
            }
            None => {
                if use_parent {
                    self.parent.clone().map(|stab| self.index.local.insert(id, stab));
                }
                f(self);
            }
        }
    }
fn annotate < F > ( & mut self , id : NodeId , use_parent : bool , attrs : & Vec < Attribute > , item_sp : Span , f : F ) where F : FnOnce ( & mut Annotator ) , { match attr :: find_stability ( self . sess . diagnostic ( ) , attrs . as_slice ( ) , item_sp ) { Some ( stab ) => { self . index . local . insert ( id , stab . clone ( ) ) ; // Don't inherit #[stable(feature = "rust1", since = "1.0.0")] if stab . level != attr :: Stable { let parent = replace ( & mut self . parent , Some ( stab ) ) ; f ( self ) ; self . parent = parent ; } else { f ( self ) ; } } None => { if use_parent { self . parent . clone ( ) . map ( | stab | self . index . local . insert ( id , stab ) ) ; } f ( self ) ; } } }
Determine the stability for a node based on its attributes and inherited
stability.
Determine the stability for a node based on its attributes and inherited stability .
&mut self
id
NodeId
use_parent
bool
attrs
&Vec<Attribute>
item_sp
Span
f
F
&mut self
id
NodeId
use_parent
bool
attrs
&Vec<Attribute>
item_sp
Span
f
F