// 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 isize));
        for (param, param_ss) in generics.ty_params.iter().zip(param_sub_spans) {
            let name = escape(self.span.snippet(param_ss));
            // Append $id to name to make sure each one is unique
            let qualname = format!("{}::{}${}",
                                   prefix,
                                   name,
                                   id);
            if !self.span.filter_generated(Some(param_ss), full_span) {
                self.dumper.typedef(TypeDefData {
                    span: param_ss,
                    name: name,
                    id: param.id,
                    qualname: qualname,
                    value: String::new()
                }.lower(self.tcx));
            }
        }
        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 isize ) ) ; for ( param , param_ss ) in generics . ty_params . iter ( ) . zip ( param_sub_spans ) { let name = escape ( self . span . snippet ( param_ss ) ) ; // Append $id to name to make sure each one is unique let qualname = format ! ( " " prefix name id ) ; if ! self . span . filter_generated ( Some ( param_ss ) , full_span ) { self . dumper . typedef ( TypeDefData { span : param_ss , name : name , id : param . id , qualname : qualname , value : String :: new ( ) } . lower ( self . tcx ) ) ; } } 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