File tree 2 files changed +2
-5
lines changed
src/librustc_data_structures/obligation_forest
2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -75,9 +75,6 @@ pub struct ObligationForest<O: ForestObligation> {
75
75
done_cache : FxHashSet < O :: Predicate > ,
76
76
/// An cache of the nodes in `nodes`, indexed by predicate.
77
77
waiting_cache : FxHashMap < O :: Predicate , NodeIndex > ,
78
- /// A list of the obligations added in snapshots, to allow
79
- /// for their removal.
80
- cache_list : Vec < O :: Predicate > ,
81
78
scratch : Option < Vec < usize > > ,
82
79
}
83
80
@@ -158,7 +155,6 @@ impl<O: ForestObligation> ObligationForest<O> {
158
155
nodes : vec ! [ ] ,
159
156
done_cache : FxHashSet ( ) ,
160
157
waiting_cache : FxHashMap ( ) ,
161
- cache_list : vec ! [ ] ,
162
158
scratch : Some ( vec ! [ ] ) ,
163
159
}
164
160
}
@@ -207,7 +203,6 @@ impl<O: ForestObligation> ObligationForest<O> {
207
203
debug ! ( "register_obligation_at({:?}, {:?}) - ok, new index is {}" ,
208
204
obligation, parent, self . nodes. len( ) ) ;
209
205
v. insert ( NodeIndex :: new ( self . nodes . len ( ) ) ) ;
210
- self . cache_list . push ( obligation. as_predicate ( ) . clone ( ) ) ;
211
206
self . nodes . push ( Node :: new ( parent, obligation) ) ;
212
207
Ok ( ( ) )
213
208
}
Original file line number Diff line number Diff line change @@ -17,11 +17,13 @@ pub struct NodeIndex {
17
17
}
18
18
19
19
impl NodeIndex {
20
+ #[ inline]
20
21
pub fn new ( value : usize ) -> NodeIndex {
21
22
assert ! ( value < ( u32 :: MAX as usize ) ) ;
22
23
NodeIndex { index : NonZeroU32 :: new ( ( value as u32 ) + 1 ) . unwrap ( ) }
23
24
}
24
25
26
+ #[ inline]
25
27
pub fn get ( self ) -> usize {
26
28
( self . index . get ( ) - 1 ) as usize
27
29
}
You can’t perform that action at this time.
0 commit comments