fn process_generic_params(&mut self, generics:&ast::Generics,
                              full_span: Span,
                              prefix: &str,
                              id: NodeId) {
        // We can't only use visit_generics since we don't have spans for param
        // bindings, so we reparse the full_span to get those sub spans.
        // However full span is the entire enum/fn/struct block, so we only want
        // the first few to match the number of generics we're looking for.
        let param_sub_spans = self.span.spans_for_ty_params(full_span,
                                                           (generics.ty_params.len() as int));
        for (param, param_ss) in generics.ty_params.iter().zip(param_sub_spans.iter()) {
            // Append $id to name to make sure each one is unique
            let name = format!("{}::{}${}",
                               prefix,
                               escape(self.span.snippet(*param_ss)),
                               id);
            self.fmt.typedef_str(full_span,
                                 Some(*param_ss),
                                 param.id,
                                 &name[],
                                 "");
        }
        self.visit_generics(generics);
    }
// Dump generic params bindings, then visit_generics
Dump generic params bindings, then visit_generics
Dump generic params bindings then visit_generics
fn process_generic_params(&mut self, generics:&ast::Generics,
                              full_span: Span,
                              prefix: &str,
                              id: NodeId) {
        // We can't only use visit_generics since we don't have spans for param
        // bindings, so we reparse the full_span to get those sub spans.
        // However full span is the entire enum/fn/struct block, so we only want
        // the first few to match the number of generics we're looking for.
        let param_sub_spans = self.span.spans_for_ty_params(full_span,
                                                           (generics.ty_params.len() as int));
        for (param, param_ss) in generics.ty_params.iter().zip(param_sub_spans.iter()) {
            // Append $id to name to make sure each one is unique
            let name = format!("{}::{}${}",
                               prefix,
                               escape(self.span.snippet(*param_ss)),
                               id);
            self.fmt.typedef_str(full_span,
                                 Some(*param_ss),
                                 param.id,
                                 &name[],
                                 "");
        }
        self.visit_generics(generics);
    }
fn process_generic_params ( & mut self , generics : & ast :: Generics , full_span : Span , prefix : & str , id : NodeId ) { // We can't only use visit_generics since we don't have spans for param // bindings, so we reparse the full_span to get those sub spans. // However full span is the entire enum/fn/struct block, so we only want // the first few to match the number of generics we're looking for. let param_sub_spans = self . span . spans_for_ty_params ( full_span , ( generics . ty_params . len ( ) as int ) ) ; for ( param , param_ss ) in generics . ty_params . iter ( ) . zip ( param_sub_spans . iter ( ) ) { // Append $id to name to make sure each one is unique let name = format ! ( " " prefix escape ( self span snippet ( param_ss ) ) id ) ; self . fmt . typedef_str ( full_span , Some ( * param_ss ) , param . id , & name [ ] , " " ) ; } self . visit_generics ( generics ) ; }
Dump generic params bindings, then visit_generics
Dump generic params bindings then visit_generics
&mut self
generics
&ast::Generics
full_span
Span
prefix
&str
id
NodeId
&mut self
generics
&ast::Generics
full_span
Span
prefix
&str
id
NodeId