@@ -146,6 +146,7 @@ impl Reflector {
146146 // Entrypoint
147147 pub fn visit_ty ( & mut self , t : ty:: t ) {
148148 let bcx = self . bcx ;
149+ let tcx = bcx. ccx ( ) . tcx ;
149150 debug ! ( "reflect::visit_ty %s" , ty_to_str( bcx. ccx( ) . tcx, t) ) ;
150151
151152 match ty:: get ( t) . sty {
@@ -248,8 +249,6 @@ impl Reflector {
248249 }
249250
250251 ty:: ty_struct( did, ref substs) => {
251- let bcx = self . bcx ;
252- let tcx = bcx. ccx ( ) . tcx ;
253252 let fields = ty:: struct_fields ( tcx, did, substs) ;
254253
255254 let extra = ~[ self . c_slice ( ty_to_str ( tcx, t) . to_managed ( ) ) ,
@@ -270,7 +269,6 @@ impl Reflector {
270269 // let the visitor tell us if it wants to visit only a particular
271270 // variant?
272271 ty:: ty_enum( did, ref substs) => {
273- let bcx = self . bcx ;
274272 let ccx = bcx. ccx ( ) ;
275273 let repr = adt:: represent_type ( bcx. ccx ( ) , t) ;
276274 let variants = ty:: substd_enum_variants ( ccx. tcx , did, substs) ;
@@ -336,8 +334,12 @@ impl Reflector {
336334 }
337335 }
338336
339- // Miscallaneous extra types
340- ty:: ty_trait( _, _, _, _, _) => self . leaf ( "trait" ) ,
337+ ty:: ty_trait( _, _, _, _, _) => {
338+ let extra = [ self . c_slice ( ty_to_str ( tcx, t) . to_managed ( ) ) ] ;
339+ self . visit ( "trait" , extra) ;
340+ }
341+
342+ // Miscellaneous extra types
341343 ty:: ty_infer( _) => self . leaf ( "infer" ) ,
342344 ty:: ty_err => self . leaf ( "err" ) ,
343345 ty:: ty_param( ref p) => {
0 commit comments