@@ -364,7 +364,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
364
364
qualname : format ! ( "{}::{}" , qualname, path_to_string( p) ) ,
365
365
type_value : typ,
366
366
value : String :: new ( ) ,
367
- scope : 0
367
+ scope : 0 ,
368
+ visibility : Visibility :: Inherited ,
368
369
} . lower ( self . tcx ) ) ;
369
370
}
370
371
}
@@ -376,6 +377,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
376
377
body : Option < & ast:: Block > ,
377
378
id : ast:: NodeId ,
378
379
name : ast:: Name ,
380
+ vis : Visibility ,
379
381
span : Span ) {
380
382
debug ! ( "process_method: {}:{}" , id, name) ;
381
383
@@ -416,6 +418,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
416
418
qualname : method_data. qualname . clone ( ) ,
417
419
value : sig_str,
418
420
decl_id : decl_id,
421
+ visibility : vis,
419
422
} . lower ( self . tcx ) ) ;
420
423
}
421
424
@@ -483,7 +486,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
483
486
name : name,
484
487
id : param. id ,
485
488
qualname : qualname,
486
- value : String :: new ( )
489
+ value : String :: new ( ) ,
490
+ visibility : Visibility :: Inherited ,
487
491
} . lower ( self . tcx ) ) ;
488
492
}
489
493
}
@@ -532,7 +536,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
532
536
name : ast:: Name ,
533
537
span : Span ,
534
538
typ : & ast:: Ty ,
535
- expr : & ast:: Expr ) {
539
+ expr : & ast:: Expr ,
540
+ vis : Visibility ) {
536
541
let qualname = format ! ( "::{}" , self . tcx. node_path_str( id) ) ;
537
542
538
543
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> {
546
551
qualname : qualname,
547
552
value : self . span . snippet ( expr. span ) ,
548
553
type_value : ty_to_string ( & typ) ,
549
- scope : self . cur_scope
554
+ scope : self . cur_scope ,
555
+ visibility : vis,
550
556
} . lower ( self . tcx ) ) ;
551
557
}
552
558
@@ -588,6 +594,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
588
594
scope : self . cur_scope ,
589
595
value : val,
590
596
fields : fields,
597
+ visibility : From :: from ( & item. vis ) ,
591
598
} . lower ( self . tcx ) ) ;
592
599
}
593
600
@@ -744,6 +751,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
744
751
scope : self . cur_scope ,
745
752
value : val,
746
753
items : methods. iter ( ) . map ( |i| i. id ) . collect ( ) ,
754
+ visibility : From :: from ( & item. vis ) ,
747
755
} . lower ( self . tcx ) ) ;
748
756
}
749
757
@@ -989,7 +997,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
989
997
qualname : format ! ( "{}${}" , path_to_string( p) , id) ,
990
998
value : value,
991
999
type_value : typ,
992
- scope : 0
1000
+ scope : 0 ,
1001
+ visibility : Visibility :: Inherited ,
993
1002
} . lower ( self . tcx ) ) ;
994
1003
}
995
1004
}
@@ -1072,7 +1081,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
1072
1081
id : item. id ,
1073
1082
mod_id : mod_id,
1074
1083
name : ident. to_string ( ) ,
1075
- scope : self . cur_scope
1084
+ scope : self . cur_scope ,
1085
+ visibility : From :: from ( & item. vis ) ,
1076
1086
} . lower ( self . tcx ) ) ;
1077
1087
}
1078
1088
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>
1095
1105
span : sub_span. expect ( "No span found for use glob" ) ,
1096
1106
id : item. id ,
1097
1107
names : names,
1098
- scope : self . cur_scope
1108
+ scope : self . cur_scope ,
1109
+ visibility : From :: from ( & item. vis ) ,
1099
1110
} . lower ( self . tcx ) ) ;
1100
1111
}
1101
1112
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>
1167
1178
name : item. ident . to_string ( ) ,
1168
1179
id : item. id ,
1169
1180
qualname : qualname. clone ( ) ,
1170
- value : value
1181
+ value : value,
1182
+ visibility : From :: from ( & item. vis ) ,
1171
1183
} . lower ( self . tcx ) ) ;
1172
1184
}
1173
1185
@@ -1200,13 +1212,15 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
1200
1212
trait_item. ident . name ,
1201
1213
trait_item. span ,
1202
1214
& ty,
1203
- & expr) ;
1215
+ & expr,
1216
+ Visibility :: Public ) ;
1204
1217
}
1205
1218
ast:: TraitItemKind :: Method ( ref sig, ref body) => {
1206
1219
self . process_method ( sig,
1207
1220
body. as_ref ( ) . map ( |x| & * * x) ,
1208
1221
trait_item. id ,
1209
1222
trait_item. ident . name ,
1223
+ Visibility :: Public ,
1210
1224
trait_item. span ) ;
1211
1225
}
1212
1226
ast:: TraitItemKind :: Const ( _, None ) |
@@ -1223,13 +1237,15 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
1223
1237
impl_item. ident . name ,
1224
1238
impl_item. span ,
1225
1239
& ty,
1226
- & expr) ;
1240
+ & expr,
1241
+ From :: from ( & impl_item. vis ) ) ;
1227
1242
}
1228
1243
ast:: ImplItemKind :: Method ( ref sig, ref body) => {
1229
1244
self . process_method ( sig,
1230
1245
Some ( body) ,
1231
1246
impl_item. id ,
1232
1247
impl_item. ident . name ,
1248
+ From :: from ( & impl_item. vis ) ,
1233
1249
impl_item. span ) ;
1234
1250
}
1235
1251
ast:: ImplItemKind :: Type ( _) |
@@ -1399,7 +1415,8 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
1399
1415
qualname : format ! ( "{}${}" , path_to_string( p) , id) ,
1400
1416
value : value,
1401
1417
type_value : String :: new ( ) ,
1402
- scope : 0
1418
+ scope : 0 ,
1419
+ visibility : Visibility :: Inherited ,
1403
1420
} . lower ( self . tcx ) ) ;
1404
1421
}
1405
1422
}
0 commit comments