@@ -127,7 +127,7 @@ impl<'tcx> SafeDropGraph<'tcx> {
127
127
// assign to the variable _x, we will set the birth of _x and its child self.values a new birth.
128
128
pub fn fill_birth ( & mut self , node : usize , birth : isize ) {
129
129
self . values [ node] . birth = birth;
130
- for i in 0 ..self . alias_set . len ( ) {
130
+ for i in 0 ..self . values . len ( ) {
131
131
if self . union_is_same ( i, node) && self . values [ i] . birth == -1 {
132
132
self . values [ i] . birth = birth;
133
133
}
@@ -172,7 +172,7 @@ impl<'tcx> SafeDropGraph<'tcx> {
172
172
node. birth = self . values [ proj_id] . birth ;
173
173
node. field_id = field_idx;
174
174
self . values [ proj_id] . fields . insert ( field_idx, node. index ) ;
175
- self . alias_set . push ( self . values . len ( ) ) ;
175
+ self . alias_set . push ( self . alias_set . len ( ) ) ;
176
176
self . dead_record . push ( false ) ;
177
177
self . values . push ( node) ;
178
178
}
@@ -206,7 +206,7 @@ impl<'tcx> SafeDropGraph<'tcx> {
206
206
node. birth = self . values [ lv] . birth ;
207
207
node. field_id = field. 0 ;
208
208
self . values [ lv] . fields . insert ( field. 0 , node. index ) ;
209
- self . alias_set . push ( self . values . len ( ) ) ;
209
+ self . alias_set . push ( self . alias_set . len ( ) ) ;
210
210
self . dead_record . push ( false ) ;
211
211
self . values . push ( node) ;
212
212
}
@@ -234,7 +234,7 @@ impl<'tcx> SafeDropGraph<'tcx> {
234
234
node. birth = self . values [ lv] . birth ;
235
235
node. field_id = * index;
236
236
self . values [ lv] . fields . insert ( * index, node. index ) ;
237
- self . alias_set . push ( self . values . len ( ) ) ;
237
+ self . alias_set . push ( self . alias_set . len ( ) ) ;
238
238
self . dead_record . push ( false ) ;
239
239
self . values . push ( node) ;
240
240
}
@@ -249,7 +249,7 @@ impl<'tcx> SafeDropGraph<'tcx> {
249
249
if !self . values [ rv] . fields . contains_key ( & index) {
250
250
let need_drop = ret_alias. right_need_drop ;
251
251
let may_drop = ret_alias. right_may_drop ;
252
- let mut node = ValueNode :: new ( self . values . len ( ) , right_init, need_drop, may_drop) ;
252
+ let mut node = ValueNode :: new ( self . alias_set . len ( ) , right_init, need_drop, may_drop) ;
253
253
node. kind = TyKind :: RawPtr ;
254
254
node. birth = self . values [ rv] . birth ;
255
255
node. field_id = * index;
@@ -263,7 +263,7 @@ impl<'tcx> SafeDropGraph<'tcx> {
263
263
self . merge_alias ( lv, rv) ;
264
264
}
265
265
266
- #[ inline]
266
+ #[ inline( always ) ]
267
267
pub fn union_find ( & mut self , e : usize ) -> usize {
268
268
let mut r = e;
269
269
while self . alias_set [ r] != r {
@@ -272,7 +272,7 @@ impl<'tcx> SafeDropGraph<'tcx> {
272
272
r
273
273
}
274
274
275
- #[ inline]
275
+ #[ inline( always ) ]
276
276
pub fn union_merge ( & mut self , e1 : usize , e2 : usize ) {
277
277
let f1 = self . union_find ( e1) ;
278
278
let f2 = self . union_find ( e2) ;
@@ -289,13 +289,14 @@ impl<'tcx> SafeDropGraph<'tcx> {
289
289
}
290
290
}
291
291
292
- #[ inline]
292
+ #[ inline( always ) ]
293
293
pub fn union_is_same ( & mut self , e1 : usize , e2 : usize ) -> bool {
294
294
let f1 = self . union_find ( e1) ;
295
295
let f2 = self . union_find ( e2) ;
296
296
f1 == f2
297
297
}
298
298
299
+ #[ inline( always) ]
299
300
pub fn union_has_alias ( & mut self , e : usize ) -> bool {
300
301
for i in 0 ..self . alias_set . len ( ) {
301
302
if i == e {
0 commit comments