@@ -368,8 +368,8 @@ fn index_crate<'a>(
368
368
krate : & ' a Crate ,
369
369
) -> IndexVec < LocalDefId , AstOwner < ' a > > {
370
370
let mut indexer = Indexer { node_id_to_def_id, index : IndexVec :: new ( ) } ;
371
- indexer. index . ensure_contains_elem ( CRATE_DEF_ID , || AstOwner :: NonOwner ) ;
372
- indexer . index [ CRATE_DEF_ID ] = AstOwner :: Crate ( krate) ;
371
+ * indexer. index . ensure_contains_elem ( CRATE_DEF_ID , || AstOwner :: NonOwner ) =
372
+ AstOwner :: Crate ( krate) ;
373
373
visit:: walk_crate ( & mut indexer, krate) ;
374
374
return indexer. index ;
375
375
@@ -386,22 +386,21 @@ fn index_crate<'a>(
386
386
387
387
fn visit_item ( & mut self , item : & ' a ast:: Item ) {
388
388
let def_id = self . node_id_to_def_id [ & item. id ] ;
389
- self . index . ensure_contains_elem ( def_id, || AstOwner :: NonOwner ) ;
390
- self . index [ def_id] = AstOwner :: Item ( item) ;
389
+ * self . index . ensure_contains_elem ( def_id, || AstOwner :: NonOwner ) = AstOwner :: Item ( item) ;
391
390
visit:: walk_item ( self , item)
392
391
}
393
392
394
393
fn visit_assoc_item ( & mut self , item : & ' a ast:: AssocItem , ctxt : visit:: AssocCtxt ) {
395
394
let def_id = self . node_id_to_def_id [ & item. id ] ;
396
- self . index . ensure_contains_elem ( def_id, || AstOwner :: NonOwner ) ;
397
- self . index [ def_id ] = AstOwner :: AssocItem ( item, ctxt) ;
395
+ * self . index . ensure_contains_elem ( def_id, || AstOwner :: NonOwner ) =
396
+ AstOwner :: AssocItem ( item, ctxt) ;
398
397
visit:: walk_assoc_item ( self , item, ctxt) ;
399
398
}
400
399
401
400
fn visit_foreign_item ( & mut self , item : & ' a ast:: ForeignItem ) {
402
401
let def_id = self . node_id_to_def_id [ & item. id ] ;
403
- self . index . ensure_contains_elem ( def_id, || AstOwner :: NonOwner ) ;
404
- self . index [ def_id ] = AstOwner :: ForeignItem ( item) ;
402
+ * self . index . ensure_contains_elem ( def_id, || AstOwner :: NonOwner ) =
403
+ AstOwner :: ForeignItem ( item) ;
405
404
visit:: walk_foreign_item ( self , item) ;
406
405
}
407
406
}
0 commit comments