@@ -79,11 +79,10 @@ use rustc::dep_graph::DepNode;
79
79
use rustc:: hir:: map as hir_map;
80
80
use util:: common:: { ErrorReported , MemoizationMap } ;
81
81
use util:: nodemap:: FnvHashMap ;
82
- use write_ty_to_tcx;
82
+ use { CrateCtxt , write_ty_to_tcx} ;
83
83
84
84
use rustc_const_math:: ConstInt ;
85
85
86
- use std:: cell:: RefCell ;
87
86
use std:: collections:: HashSet ;
88
87
use std:: collections:: hash_map:: Entry :: { Occupied , Vacant } ;
89
88
use std:: rc:: Rc ;
@@ -101,22 +100,13 @@ use rustc::hir::print as pprust;
101
100
///////////////////////////////////////////////////////////////////////////
102
101
// Main entry point
103
102
104
- pub fn collect_item_types ( tcx : & TyCtxt ) {
105
- let ccx = & CrateCtxt { tcx : tcx, stack : RefCell :: new ( Vec :: new ( ) ) } ;
106
- let mut visitor = CollectItemTypesVisitor { ccx : ccx } ;
103
+ pub fn collect_item_types ( ccx : & CrateCtxt ) {
104
+ let mut visitor = CollectItemTypesVisitor { ccx : ccx } ;
107
105
ccx. tcx . visit_all_items_in_krate ( DepNode :: CollectItem , & mut visitor) ;
108
106
}
109
107
110
108
///////////////////////////////////////////////////////////////////////////
111
109
112
- struct CrateCtxt < ' a , ' tcx : ' a > {
113
- tcx : & ' a TyCtxt < ' tcx > ,
114
-
115
- // This stack is used to identify cycles in the user's source.
116
- // Note that these cycles can cross multiple items.
117
- stack : RefCell < Vec < AstConvRequest > > ,
118
- }
119
-
120
110
/// Context specific to some particular item. This is what implements
121
111
/// AstConv. It has information about the predicates that are defined
122
112
/// on the trait. Unfortunately, this predicate information is
@@ -134,7 +124,7 @@ struct ItemCtxt<'a,'tcx:'a> {
134
124
}
135
125
136
126
#[ derive( Copy , Clone , PartialEq , Eq ) ]
137
- enum AstConvRequest {
127
+ pub enum AstConvRequest {
138
128
GetItemTypeScheme ( DefId ) ,
139
129
GetTraitDef ( DefId ) ,
140
130
EnsureSuperPredicates ( DefId ) ,
0 commit comments