@@ -27,7 +27,7 @@ extern crate syntax_pos;
27
27
28
28
use rustc:: dep_graph:: DepNode ;
29
29
use rustc:: hir:: { self , PatKind } ;
30
- use rustc:: hir:: def:: { self , Def } ;
30
+ use rustc:: hir:: def:: Def ;
31
31
use rustc:: hir:: def_id:: { CRATE_DEF_INDEX , DefId } ;
32
32
use rustc:: hir:: intravisit:: { self , Visitor , NestedVisitorMap } ;
33
33
use rustc:: hir:: itemlikevisit:: DeepVisitor ;
@@ -71,7 +71,6 @@ impl<'a, 'tcx> Visitor<'tcx> for PubRestrictedVisitor<'a, 'tcx> {
71
71
72
72
struct EmbargoVisitor < ' a , ' tcx : ' a > {
73
73
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
74
- export_map : & ' a def:: ExportMap ,
75
74
76
75
// Accessibility levels for reachable nodes
77
76
access_levels : AccessLevels ,
@@ -324,7 +323,7 @@ impl<'a, 'tcx> Visitor<'tcx> for EmbargoVisitor<'a, 'tcx> {
324
323
// This code is here instead of in visit_item so that the
325
324
// crate module gets processed as well.
326
325
if self . prev_level . is_some ( ) {
327
- if let Some ( exports) = self . export_map . get ( & id) {
326
+ if let Some ( exports) = self . tcx . export_map . get ( & id) {
328
327
for export in exports {
329
328
if let Some ( node_id) = self . tcx . hir . as_local_node_id ( export. def . def_id ( ) ) {
330
329
self . update ( node_id, Some ( AccessLevel :: Exported ) ) ;
@@ -1204,9 +1203,7 @@ impl<'a, 'tcx> Visitor<'tcx> for PrivateItemsInPublicInterfacesVisitor<'a, 'tcx>
1204
1203
fn visit_pat ( & mut self , _: & ' tcx hir:: Pat ) { }
1205
1204
}
1206
1205
1207
- pub fn check_crate < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
1208
- export_map : & def:: ExportMap )
1209
- -> AccessLevels {
1206
+ pub fn check_crate < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) -> AccessLevels {
1210
1207
let _task = tcx. dep_graph . in_task ( DepNode :: Privacy ) ;
1211
1208
1212
1209
let krate = tcx. hir . krate ( ) ;
@@ -1226,7 +1223,6 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1226
1223
// items which are reachable from external crates based on visibility.
1227
1224
let mut visitor = EmbargoVisitor {
1228
1225
tcx : tcx,
1229
- export_map : export_map,
1230
1226
access_levels : Default :: default ( ) ,
1231
1227
prev_level : Some ( AccessLevel :: Public ) ,
1232
1228
changed : false ,
0 commit comments