@@ -7,8 +7,8 @@ use rustc_ast::EnumDef;
7
7
use rustc_data_structures:: intern:: Interned ;
8
8
use rustc_hir:: def_id:: LocalDefId ;
9
9
use rustc_hir:: def_id:: CRATE_DEF_ID ;
10
+ use rustc_middle:: middle:: privacy:: Level ;
10
11
use rustc_middle:: middle:: privacy:: { EffectiveVisibilities , EffectiveVisibility } ;
11
- use rustc_middle:: middle:: privacy:: { IntoDefIdTree , Level } ;
12
12
use rustc_middle:: ty:: { DefIdTree , Visibility } ;
13
13
use std:: mem;
14
14
@@ -67,13 +67,6 @@ impl Resolver<'_, '_> {
67
67
}
68
68
}
69
69
70
- impl < ' a , ' b , ' tcx > IntoDefIdTree for & ' b mut Resolver < ' a , ' tcx > {
71
- type Tree = & ' b Resolver < ' a , ' tcx > ;
72
- fn tree ( self ) -> Self :: Tree {
73
- self
74
- }
75
- }
76
-
77
70
impl < ' r , ' a , ' tcx > EffectiveVisibilitiesVisitor < ' r , ' a , ' tcx > {
78
71
/// Fills the `Resolver::effective_visibilities` table with public & exported items
79
72
/// For now, this doesn't resolve macros (FIXME) and cannot resolve Impl, as we
@@ -167,26 +160,28 @@ impl<'r, 'a, 'tcx> EffectiveVisibilitiesVisitor<'r, 'a, 'tcx> {
167
160
let nominal_vis = binding. vis . expect_local ( ) ;
168
161
let private_vis = self . cheap_private_vis ( parent_id) ;
169
162
let inherited_eff_vis = self . effective_vis_or_private ( parent_id) ;
163
+ let tcx = self . r . tcx ;
170
164
self . changed |= self . import_effective_visibilities . update (
171
165
binding,
172
166
nominal_vis,
173
- |r| ( private_vis. unwrap_or_else ( || r. private_vis_import ( binding) ) , r ) ,
167
+ || private_vis. unwrap_or_else ( || self . r . private_vis_import ( binding) ) ,
174
168
inherited_eff_vis,
175
169
parent_id. level ( ) ,
176
- & mut * self . r ,
170
+ tcx ,
177
171
) ;
178
172
}
179
173
180
174
fn update_def ( & mut self , def_id : LocalDefId , nominal_vis : Visibility , parent_id : ParentId < ' a > ) {
181
175
let private_vis = self . cheap_private_vis ( parent_id) ;
182
176
let inherited_eff_vis = self . effective_vis_or_private ( parent_id) ;
177
+ let tcx = self . r . tcx ;
183
178
self . changed |= self . def_effective_visibilities . update (
184
179
def_id,
185
180
nominal_vis,
186
- |r| ( private_vis. unwrap_or_else ( || r. private_vis_def ( def_id) ) , r ) ,
181
+ || private_vis. unwrap_or_else ( || self . r . private_vis_def ( def_id) ) ,
187
182
inherited_eff_vis,
188
183
parent_id. level ( ) ,
189
- & mut * self . r ,
184
+ tcx ,
190
185
) ;
191
186
}
192
187
0 commit comments