fn build_reduced_graph_for_variant(&mut self,
                                       variant: &Variant,
                                       item_id: DefId,
                                       parent: ReducedGraphParent,
                                       parent_public: bool) {
        let ident = variant.node.name;
        // XXX: this is unfortunate to have to do this privacy calculation
        //      here. This should be living in middle::privacy, but it's
        //      necessary to keep around in some form becaues of glob imports...
        let is_public = parent_public && variant.node.vis != ast::Private;

        match variant.node.kind {
            TupleVariantKind(_) => {
                let (child, _) = self.add_child(ident, parent, ForbidDuplicateValues,
                                                variant.span);
                child.define_value(DefVariant(item_id,
                                              local_def(variant.node.id), false),
                                   variant.span, is_public);
            }
            StructVariantKind(_) => {
                let (child, _) = self.add_child(ident, parent, ForbidDuplicateTypesAndValues,
                                                variant.span);
                child.define_type(DefVariant(item_id,
                                             local_def(variant.node.id), true),
                                  variant.span, is_public);
                self.structs.insert(local_def(variant.node.id));
            }
        }
    }
// Constructs the reduced graph for one variant. Variants exist in the
// type and/or value namespaces.
Constructs the reduced graph for one variant. Variants exist in the
type and/or value namespaces.
Constructs the reduced graph for one variant . Variants exist in the type and / or value namespaces .
fn build_reduced_graph_for_variant(&mut self,
                                       variant: &Variant,
                                       item_id: DefId,
                                       parent: ReducedGraphParent,
                                       parent_public: bool) {
        let ident = variant.node.name;
        // XXX: this is unfortunate to have to do this privacy calculation
        //      here. This should be living in middle::privacy, but it's
        //      necessary to keep around in some form becaues of glob imports...
        let is_public = parent_public && variant.node.vis != ast::Private;
        match variant.node.kind {
            TupleVariantKind(_) => {
                let (child, _) = self.add_child(ident, parent, ForbidDuplicateValues,
                                                variant.span);
                child.define_value(DefVariant(item_id,
                                              local_def(variant.node.id), false),
                                   variant.span, is_public);
            }
            StructVariantKind(_) => {
                let (child, _) = self.add_child(ident, parent, ForbidDuplicateTypesAndValues,
                                                variant.span);
                child.define_type(DefVariant(item_id,
                                             local_def(variant.node.id), true),
                                  variant.span, is_public);
                self.structs.insert(local_def(variant.node.id));
            }
        }
    }
fn build_reduced_graph_for_variant ( & mut self , variant : & Variant , item_id : DefId , parent : ReducedGraphParent , parent_public : bool ) { let ident = variant . node . name ; // XXX: this is unfortunate to have to do this privacy calculation //      here. This should be living in middle::privacy, but it's //      necessary to keep around in some form becaues of glob imports... let is_public = parent_public && variant . node . vis != ast :: Private ; match variant . node . kind { TupleVariantKind ( _ ) => { let ( child , _ ) = self . add_child ( ident , parent , ForbidDuplicateValues , variant . span ) ; child . define_value ( DefVariant ( item_id , local_def ( variant . node . id ) , false ) , variant . span , is_public ) ; } StructVariantKind ( _ ) => { let ( child , _ ) = self . add_child ( ident , parent , ForbidDuplicateTypesAndValues , variant . span ) ; child . define_type ( DefVariant ( item_id , local_def ( variant . node . id ) , true ) , variant . span , is_public ) ; self . structs . insert ( local_def ( variant . node . id ) ) ; } } }
Constructs the reduced graph for one variant.
Constructs the reduced graph for one variant .
&mut self
variant
&Variant
item_id
DefId
parent
ReducedGraphParent
parent_public
bool
&mut self
variant
&Variant
item_id
DefId
parent
ReducedGraphParent
parent_public
bool