Skip to content

Commit 85ac63e

Browse files
committed
rename CrateIndex to IndexBuilder
1 parent b5fa8ab commit 85ac63e

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

src/librustc_metadata/encoder.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use rustc::hir::intravisit::Visitor;
5454
use rustc::hir::intravisit;
5555
use rustc::hir::map::DefKey;
5656

57-
use super::index_builder::{CrateIndex, XRef};
57+
use super::index_builder::{IndexBuilder, XRef};
5858

5959
pub struct EncodeContext<'a, 'tcx: 'a> {
6060
pub diag: &'a Handler,
@@ -134,7 +134,7 @@ fn encode_item_variances(rbml_w: &mut Encoder,
134134

135135
fn encode_bounds_and_type_for_item<'a, 'tcx>(rbml_w: &mut Encoder,
136136
ecx: &EncodeContext<'a, 'tcx>,
137-
index: &mut CrateIndex<'a, 'tcx>,
137+
index: &mut IndexBuilder<'a, 'tcx>,
138138
id: NodeId) {
139139
encode_bounds_and_type(rbml_w,
140140
ecx,
@@ -145,7 +145,7 @@ fn encode_bounds_and_type_for_item<'a, 'tcx>(rbml_w: &mut Encoder,
145145

146146
fn encode_bounds_and_type<'a, 'tcx>(rbml_w: &mut Encoder,
147147
ecx: &EncodeContext<'a, 'tcx>,
148-
index: &mut CrateIndex<'a, 'tcx>,
148+
index: &mut IndexBuilder<'a, 'tcx>,
149149
scheme: &ty::TypeScheme<'tcx>,
150150
predicates: &ty::GenericPredicates<'tcx>) {
151151
encode_generics(rbml_w, ecx, index, &scheme.generics, &predicates);
@@ -204,7 +204,7 @@ fn encode_enum_variant_info<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
204204
rbml_w: &mut Encoder,
205205
did: DefId,
206206
vis: &hir::Visibility,
207-
index: &mut CrateIndex<'a, 'tcx>) {
207+
index: &mut IndexBuilder<'a, 'tcx>) {
208208
debug!("encode_enum_variant_info(did={:?})", did);
209209
let repr_hints = ecx.tcx.lookup_repr_hints(did);
210210
let repr_type = ecx.tcx.enum_repr_type(repr_hints.get(0));
@@ -424,7 +424,7 @@ fn encode_item_sort(rbml_w: &mut Encoder, sort: char) {
424424
fn encode_field<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
425425
rbml_w: &mut Encoder,
426426
field: ty::FieldDef<'tcx>,
427-
index: &mut CrateIndex<'a, 'tcx>) {
427+
index: &mut IndexBuilder<'a, 'tcx>) {
428428
let nm = field.name;
429429
let id = ecx.local_id(field.did);
430430

@@ -448,7 +448,7 @@ fn encode_info_for_struct_ctor<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
448448
rbml_w: &mut Encoder,
449449
name: Name,
450450
struct_def: &hir::VariantData,
451-
index: &mut CrateIndex<'a, 'tcx>,
451+
index: &mut IndexBuilder<'a, 'tcx>,
452452
struct_id: NodeId) {
453453
let ctor_id = struct_def.id();
454454
let ctor_def_id = ecx.tcx.map.local_def_id(ctor_id);
@@ -480,7 +480,7 @@ fn encode_info_for_struct_ctor<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
480480

481481
fn encode_generics<'a, 'tcx>(rbml_w: &mut Encoder,
482482
ecx: &EncodeContext<'a, 'tcx>,
483-
index: &mut CrateIndex<'a, 'tcx>,
483+
index: &mut IndexBuilder<'a, 'tcx>,
484484
generics: &ty::Generics<'tcx>,
485485
predicates: &ty::GenericPredicates<'tcx>)
486486
{
@@ -493,7 +493,7 @@ fn encode_generics<'a, 'tcx>(rbml_w: &mut Encoder,
493493
}
494494

495495
fn encode_predicates<'a,'tcx>(rbml_w: &mut Encoder,
496-
index: &mut CrateIndex<'a, 'tcx>,
496+
index: &mut IndexBuilder<'a, 'tcx>,
497497
predicates: &ty::GenericPredicates<'tcx>,
498498
tag: usize)
499499
{
@@ -510,7 +510,7 @@ fn encode_predicates<'a,'tcx>(rbml_w: &mut Encoder,
510510

511511
fn encode_method_ty_fields<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
512512
rbml_w: &mut Encoder,
513-
index: &mut CrateIndex<'a, 'tcx>,
513+
index: &mut IndexBuilder<'a, 'tcx>,
514514
method_ty: &ty::Method<'tcx>) {
515515
encode_def_id_and_key(ecx, rbml_w, method_ty.def_id);
516516
encode_name(rbml_w, method_ty.name);
@@ -528,7 +528,7 @@ fn encode_method_ty_fields<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
528528

529529
fn encode_info_for_associated_const<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
530530
rbml_w: &mut Encoder,
531-
index: &mut CrateIndex<'a, 'tcx>,
531+
index: &mut IndexBuilder<'a, 'tcx>,
532532
associated_const: &ty::AssociatedConst,
533533
parent_id: NodeId,
534534
impl_item_opt: Option<&hir::ImplItem>) {
@@ -570,7 +570,7 @@ fn encode_info_for_associated_const<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
570570

571571
fn encode_info_for_method<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
572572
rbml_w: &mut Encoder,
573-
index: &mut CrateIndex<'a, 'tcx>,
573+
index: &mut IndexBuilder<'a, 'tcx>,
574574
m: &ty::Method<'tcx>,
575575
is_default_impl: bool,
576576
parent_id: NodeId,
@@ -618,7 +618,7 @@ fn encode_info_for_method<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
618618

619619
fn encode_info_for_associated_type<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
620620
rbml_w: &mut Encoder,
621-
index: &mut CrateIndex<'a, 'tcx>,
621+
index: &mut IndexBuilder<'a, 'tcx>,
622622
associated_type: &ty::AssociatedType<'tcx>,
623623
parent_id: NodeId,
624624
impl_item_opt: Option<&hir::ImplItem>) {
@@ -765,7 +765,7 @@ fn encode_xrefs<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
765765
fn encode_info_for_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
766766
rbml_w: &mut Encoder,
767767
item: &hir::Item,
768-
index: &mut CrateIndex<'a, 'tcx>) {
768+
index: &mut IndexBuilder<'a, 'tcx>) {
769769
let tcx = ecx.tcx;
770770

771771
debug!("encoding info for item at {}",
@@ -1237,7 +1237,7 @@ fn encode_info_for_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
12371237
fn encode_info_for_foreign_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
12381238
rbml_w: &mut Encoder,
12391239
nitem: &hir::ForeignItem,
1240-
index: &mut CrateIndex<'a, 'tcx>) {
1240+
index: &mut IndexBuilder<'a, 'tcx>) {
12411241
debug!("writing foreign item {}", ecx.tcx.node_path_str(nitem.id));
12421242
let def_id = ecx.tcx.map.local_def_id(nitem.id);
12431243
let abi = ecx.tcx.map.get_foreign_abi(nitem.id);
@@ -1285,7 +1285,7 @@ fn encode_info_for_foreign_item<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
12851285
fn my_visit_expr(expr: &hir::Expr,
12861286
rbml_w: &mut Encoder,
12871287
ecx: &EncodeContext,
1288-
index: &mut CrateIndex) {
1288+
index: &mut IndexBuilder) {
12891289
match expr.node {
12901290
hir::ExprClosure(..) => {
12911291
let def_id = ecx.tcx.map.local_def_id(expr.id);
@@ -1316,7 +1316,7 @@ fn my_visit_expr(expr: &hir::Expr,
13161316
struct EncodeVisitor<'a, 'b:'a, 'c:'a, 'tcx:'c> {
13171317
rbml_w_for_visit_item: &'a mut Encoder<'b>,
13181318
ecx: &'a EncodeContext<'c, 'tcx>,
1319-
index: &'a mut CrateIndex<'c, 'tcx>,
1319+
index: &'a mut IndexBuilder<'c, 'tcx>,
13201320
}
13211321

13221322
impl<'a, 'b, 'c, 'tcx> Visitor<'tcx> for EncodeVisitor<'a, 'b, 'c, 'tcx> {
@@ -1350,10 +1350,10 @@ impl<'a, 'b, 'c, 'tcx> Visitor<'tcx> for EncodeVisitor<'a, 'b, 'c, 'tcx> {
13501350

13511351
fn encode_info_for_items<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
13521352
rbml_w: &mut Encoder)
1353-
-> CrateIndex<'a, 'tcx> {
1353+
-> IndexBuilder<'a, 'tcx> {
13541354
let krate = ecx.tcx.map.krate();
13551355

1356-
let mut index = CrateIndex::new(ecx);
1356+
let mut index = IndexBuilder::new(ecx);
13571357
rbml_w.start_tag(tag_items_data);
13581358

13591359
{

src/librustc_metadata/index_builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc::hir::def_id::DefId;
1616
use rustc::ty;
1717
use rustc_data_structures::fnv::FnvHashMap;
1818

19-
pub struct CrateIndex<'a, 'tcx> {
19+
pub struct IndexBuilder<'a, 'tcx> {
2020
dep_graph: &'a DepGraph,
2121
items: IndexData,
2222
xrefs: FnvHashMap<XRef<'tcx>, u32>, // sequentially-assigned
@@ -26,9 +26,9 @@ pub struct CrateIndex<'a, 'tcx> {
2626
#[derive(PartialEq, Eq, Hash)]
2727
pub enum XRef<'tcx> { Predicate(ty::Predicate<'tcx>) }
2828

29-
impl<'a, 'tcx> CrateIndex<'a, 'tcx> {
29+
impl<'a, 'tcx> IndexBuilder<'a, 'tcx> {
3030
pub fn new(ecx: &EncodeContext<'a, 'tcx>) -> Self {
31-
CrateIndex {
31+
IndexBuilder {
3232
dep_graph: &ecx.tcx.dep_graph,
3333
items: IndexData::new(ecx.tcx.map.num_local_def_ids()),
3434
xrefs: FnvHashMap()

0 commit comments

Comments
 (0)