@@ -364,7 +364,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
364364 qualname : format ! ( "{}::{}" , qualname, path_to_string( p) ) ,
365365 type_value : typ,
366366 value : String :: new ( ) ,
367- scope : 0
367+ scope : 0 ,
368+ visibility : Visibility :: Inherited ,
368369 } . lower ( self . tcx ) ) ;
369370 }
370371 }
@@ -376,6 +377,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
376377 body : Option < & ast:: Block > ,
377378 id : ast:: NodeId ,
378379 name : ast:: Name ,
380+ vis : Visibility ,
379381 span : Span ) {
380382 debug ! ( "process_method: {}:{}" , id, name) ;
381383
@@ -416,6 +418,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
416418 qualname : method_data. qualname . clone ( ) ,
417419 value : sig_str,
418420 decl_id : decl_id,
421+ visibility : vis,
419422 } . lower ( self . tcx ) ) ;
420423 }
421424
@@ -483,7 +486,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
483486 name : name,
484487 id : param. id ,
485488 qualname : qualname,
486- value : String :: new ( )
489+ value : String :: new ( ) ,
490+ visibility : Visibility :: Inherited ,
487491 } . lower ( self . tcx ) ) ;
488492 }
489493 }
@@ -532,7 +536,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
532536 name : ast:: Name ,
533537 span : Span ,
534538 typ : & ast:: Ty ,
535- expr : & ast:: Expr ) {
539+ expr : & ast:: Expr ,
540+ vis : Visibility ) {
536541 let qualname = format ! ( "::{}" , self . tcx. node_path_str( id) ) ;
537542
538543 let sub_span = self . span . sub_span_after_keyword ( span, keywords:: Const ) ;
@@ -546,7 +551,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
546551 qualname : qualname,
547552 value : self . span . snippet ( expr. span ) ,
548553 type_value : ty_to_string ( & typ) ,
549- scope : self . cur_scope
554+ scope : self . cur_scope ,
555+ visibility : vis,
550556 } . lower ( self . tcx ) ) ;
551557 }
552558
@@ -588,6 +594,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
588594 scope : self . cur_scope ,
589595 value : val,
590596 fields : fields,
597+ visibility : From :: from ( & item. vis ) ,
591598 } . lower ( self . tcx ) ) ;
592599 }
593600
@@ -744,6 +751,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
744751 scope : self . cur_scope ,
745752 value : val,
746753 items : methods. iter ( ) . map ( |i| i. id ) . collect ( ) ,
754+ visibility : From :: from ( & item. vis ) ,
747755 } . lower ( self . tcx ) ) ;
748756 }
749757
@@ -989,7 +997,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
989997 qualname : format ! ( "{}${}" , path_to_string( p) , id) ,
990998 value : value,
991999 type_value : typ,
992- scope : 0
1000+ scope : 0 ,
1001+ visibility : Visibility :: Inherited ,
9931002 } . lower ( self . tcx ) ) ;
9941003 }
9951004 }
@@ -1072,7 +1081,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
10721081 id : item. id ,
10731082 mod_id : mod_id,
10741083 name : ident. to_string ( ) ,
1075- scope : self . cur_scope
1084+ scope : self . cur_scope ,
1085+ visibility : From :: from ( & item. vis ) ,
10761086 } . lower ( self . tcx ) ) ;
10771087 }
10781088 self . write_sub_paths_truncated ( path, true ) ;
@@ -1095,7 +1105,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
10951105 span : sub_span. expect ( "No span found for use glob" ) ,
10961106 id : item. id ,
10971107 names : names,
1098- scope : self . cur_scope
1108+ scope : self . cur_scope ,
1109+ visibility : From :: from ( & item. vis ) ,
10991110 } . lower ( self . tcx ) ) ;
11001111 }
11011112 self . write_sub_paths ( path, true ) ;
@@ -1167,7 +1178,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
11671178 name : item. ident . to_string ( ) ,
11681179 id : item. id ,
11691180 qualname : qualname. clone ( ) ,
1170- value : value
1181+ value : value,
1182+ visibility : From :: from ( & item. vis ) ,
11711183 } . lower ( self . tcx ) ) ;
11721184 }
11731185
@@ -1200,13 +1212,15 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
12001212 trait_item. ident . name ,
12011213 trait_item. span ,
12021214 & ty,
1203- & expr) ;
1215+ & expr,
1216+ Visibility :: Public ) ;
12041217 }
12051218 ast:: TraitItemKind :: Method ( ref sig, ref body) => {
12061219 self . process_method ( sig,
12071220 body. as_ref ( ) . map ( |x| & * * x) ,
12081221 trait_item. id ,
12091222 trait_item. ident . name ,
1223+ Visibility :: Public ,
12101224 trait_item. span ) ;
12111225 }
12121226 ast:: TraitItemKind :: Const ( _, None ) |
@@ -1223,13 +1237,15 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
12231237 impl_item. ident . name ,
12241238 impl_item. span ,
12251239 & ty,
1226- & expr) ;
1240+ & expr,
1241+ From :: from ( & impl_item. vis ) ) ;
12271242 }
12281243 ast:: ImplItemKind :: Method ( ref sig, ref body) => {
12291244 self . process_method ( sig,
12301245 Some ( body) ,
12311246 impl_item. id ,
12321247 impl_item. ident . name ,
1248+ From :: from ( & impl_item. vis ) ,
12331249 impl_item. span ) ;
12341250 }
12351251 ast:: ImplItemKind :: Type ( _) |
@@ -1399,7 +1415,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
13991415 qualname : format ! ( "{}${}" , path_to_string( p) , id) ,
14001416 value : value,
14011417 type_value : String :: new ( ) ,
1402- scope : 0
1418+ scope : 0 ,
1419+ visibility : Visibility :: Inherited ,
14031420 } . lower ( self . tcx ) ) ;
14041421 }
14051422 }
0 commit comments