@@ -1149,8 +1149,32 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
11491149 & trait_item. attrs ,
11501150 trait_item. span ) ;
11511151 }
1152- ast:: TraitItemKind :: Const ( _, None ) |
1153- ast:: TraitItemKind :: Type ( ..) |
1152+ ast:: TraitItemKind :: Type ( ref _bounds, ref default_ty) => {
1153+ // FIXME do something with _bounds (for type refs)
1154+ let name = trait_item. ident . name . to_string ( ) ;
1155+ let qualname = format ! ( "::{}" , self . tcx. node_path_str( trait_item. id) ) ;
1156+ let sub_span = self . span . sub_span_after_keyword ( trait_item. span , keywords:: Type ) ;
1157+
1158+ if !self . span . filter_generated ( sub_span, trait_item. span ) {
1159+ self . dumper . typedef ( TypeDefData {
1160+ span : sub_span. expect ( "No span found for assoc type" ) ,
1161+ name : name,
1162+ id : trait_item. id ,
1163+ qualname : qualname,
1164+ value : self . span . snippet ( trait_item. span ) ,
1165+ visibility : Visibility :: Public ,
1166+ parent : Some ( trait_id) ,
1167+ docs : docs_for_attrs ( & trait_item. attrs ) ,
1168+ sig : None ,
1169+ attributes : trait_item. attrs . clone ( ) ,
1170+ } . lower ( self . tcx ) ) ;
1171+ }
1172+
1173+ if let & Some ( ref default_ty) = default_ty {
1174+ self . visit_ty ( default_ty)
1175+ }
1176+ }
1177+ ast:: TraitItemKind :: Const ( ref ty, None ) => self . visit_ty ( ty) ,
11541178 ast:: TraitItemKind :: Macro ( _) => { }
11551179 }
11561180 }
@@ -1177,7 +1201,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
11771201 & impl_item. attrs ,
11781202 impl_item. span ) ;
11791203 }
1180- ast:: ImplItemKind :: Type ( _ ) |
1204+ ast:: ImplItemKind :: Type ( ref ty ) => self . visit_ty ( ty ) ,
11811205 ast:: ImplItemKind :: Macro ( _) => { }
11821206 }
11831207 }
0 commit comments