@@ -26,8 +26,7 @@ use util::nodemap::{NodeMap, NodeSet};
26
26
27
27
use syntax:: ast;
28
28
use syntax:: ast_map;
29
- use syntax:: ast_util;
30
- use syntax:: ast_util:: { is_local, local_def} ;
29
+ use syntax:: ast_util:: { is_local, local_def, PostExpansionMethod } ;
31
30
use syntax:: attr;
32
31
use syntax:: codemap:: Span ;
33
32
use syntax:: parse:: token;
@@ -264,10 +263,10 @@ impl<'a> Visitor<()> for EmbargoVisitor<'a> {
264
263
265
264
if public_ty || public_trait {
266
265
for method in methods. iter ( ) {
267
- let meth_public = match ast_util :: method_explicit_self ( & * * method) . node {
266
+ let meth_public = match method. pe_explicit_self ( ) . node {
268
267
ast:: SelfStatic => public_ty,
269
268
_ => true ,
270
- } && ast_util :: method_vis ( & * * method) == ast:: Public ;
269
+ } && method. pe_vis ( ) == ast:: Public ;
271
270
if meth_public || tr. is_some ( ) {
272
271
self . exported_items . insert ( method. id ) ;
273
272
}
@@ -457,8 +456,8 @@ impl<'a> PrivacyVisitor<'a> {
457
456
let imp = self . tcx . map . get_parent_did ( closest_private_id) ;
458
457
match ty:: impl_trait_ref ( self . tcx , imp) {
459
458
Some ( ..) => return Allowable ,
460
- _ if ast_util :: method_vis ( & * * m ) == ast:: Public => return Allowable ,
461
- _ => ast_util :: method_vis ( & * * m )
459
+ _ if m . pe_vis ( ) == ast:: Public => return Allowable ,
460
+ _ => m . pe_vis ( )
462
461
}
463
462
}
464
463
Some ( ast_map:: NodeTraitMethod ( _) ) => {
@@ -1079,7 +1078,7 @@ impl<'a> SanePrivacyVisitor<'a> {
1079
1078
"visibility qualifiers have no effect on trait \
1080
1079
impls") ;
1081
1080
for m in methods. iter ( ) {
1082
- check_inherited ( m. span , ast_util :: method_vis ( & * * m ) , "" ) ;
1081
+ check_inherited ( m. span , m . pe_vis ( ) , "" ) ;
1083
1082
}
1084
1083
}
1085
1084
@@ -1111,7 +1110,7 @@ impl<'a> SanePrivacyVisitor<'a> {
1111
1110
for m in methods. iter ( ) {
1112
1111
match * m {
1113
1112
ast:: Provided ( ref m) => {
1114
- check_inherited ( m. span , ast_util :: method_vis ( & * * m ) ,
1113
+ check_inherited ( m. span , m . pe_vis ( ) ,
1115
1114
"unnecessary visibility" ) ;
1116
1115
}
1117
1116
ast:: Required ( ref m) => {
@@ -1149,7 +1148,7 @@ impl<'a> SanePrivacyVisitor<'a> {
1149
1148
match item. node {
1150
1149
ast:: ItemImpl ( _, _, _, ref methods) => {
1151
1150
for m in methods. iter ( ) {
1152
- check_inherited ( tcx, m. span , ast_util :: method_vis ( & * * m ) ) ;
1151
+ check_inherited ( tcx, m. span , m . pe_vis ( ) ) ;
1153
1152
}
1154
1153
}
1155
1154
ast:: ItemForeignMod ( ref fm) => {
@@ -1175,7 +1174,7 @@ impl<'a> SanePrivacyVisitor<'a> {
1175
1174
match * m {
1176
1175
ast:: Required ( ..) => { }
1177
1176
ast:: Provided ( ref m) => check_inherited ( tcx, m. span ,
1178
- ast_util :: method_vis ( & * * m ) ) ,
1177
+ m . pe_vis ( ) ) ,
1179
1178
}
1180
1179
}
1181
1180
}
@@ -1345,7 +1344,7 @@ impl<'a> Visitor<()> for VisiblePrivateTypesVisitor<'a> {
1345
1344
// methods will be visible as `Public::foo`.
1346
1345
let mut found_pub_static = false ;
1347
1346
for method in methods. iter ( ) {
1348
- if ast_util :: method_explicit_self ( & * * method) . node == ast:: SelfStatic &&
1347
+ if method. pe_explicit_self ( ) . node == ast:: SelfStatic &&
1349
1348
self . exported_items . contains ( & method. id ) {
1350
1349
found_pub_static = true ;
1351
1350
visit:: walk_method_helper ( self , & * * method, ( ) ) ;
0 commit comments