Skip to content

Commit 22bc9e1

Browse files
committed
Auto merge of #64778 - csmoe:index, r=eddyb
Introduce librustc_index crate Closes #50592
2 parents e0436d9 + 64f61c7 commit 22bc9e1

File tree

148 files changed

+249
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+249
-203
lines changed

Cargo.lock

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,6 +3081,7 @@ dependencies = [
30813081
"rustc_data_structures",
30823082
"rustc_errors",
30833083
"rustc_fs_util",
3084+
"rustc_index",
30843085
"rustc_macros",
30853086
"rustc_target",
30863087
"scoped-tls",
@@ -3361,6 +3362,7 @@ dependencies = [
33613362
"rustc_errors",
33623363
"rustc_fs_util",
33633364
"rustc_incremental",
3365+
"rustc_index",
33643366
"rustc_target",
33653367
"serialize",
33663368
"syntax",
@@ -3399,6 +3401,7 @@ dependencies = [
33993401
"rustc-hash",
34003402
"rustc-rayon",
34013403
"rustc-rayon-core",
3404+
"rustc_index",
34023405
"serialize",
34033406
"smallvec",
34043407
"stable_deref_trait",
@@ -3462,6 +3465,14 @@ dependencies = [
34623465
"syntax_pos",
34633466
]
34643467

3468+
[[package]]
3469+
name = "rustc_index"
3470+
version = "0.0.0"
3471+
dependencies = [
3472+
"serialize",
3473+
"smallvec",
3474+
]
3475+
34653476
[[package]]
34663477
name = "rustc_interface"
34673478
version = "0.0.0"
@@ -3506,6 +3517,7 @@ dependencies = [
35063517
"log",
35073518
"rustc",
35083519
"rustc_data_structures",
3520+
"rustc_index",
35093521
"rustc_target",
35103522
"syntax",
35113523
"syntax_pos",
@@ -3551,6 +3563,7 @@ dependencies = [
35513563
"rustc",
35523564
"rustc_data_structures",
35533565
"rustc_errors",
3566+
"rustc_index",
35543567
"rustc_target",
35553568
"serialize",
35563569
"smallvec",
@@ -3573,6 +3586,7 @@ dependencies = [
35733586
"rustc_apfloat",
35743587
"rustc_data_structures",
35753588
"rustc_errors",
3589+
"rustc_index",
35763590
"rustc_lexer",
35773591
"rustc_target",
35783592
"serialize",
@@ -3672,6 +3686,7 @@ dependencies = [
36723686
"bitflags",
36733687
"log",
36743688
"rustc_data_structures",
3689+
"rustc_index",
36753690
"serialize",
36763691
"syntax_pos",
36773692
]
@@ -3720,6 +3735,7 @@ dependencies = [
37203735
"rustc",
37213736
"rustc_data_structures",
37223737
"rustc_errors",
3738+
"rustc_index",
37233739
"rustc_target",
37243740
"smallvec",
37253741
"syntax",
@@ -4236,6 +4252,7 @@ dependencies = [
42364252
"log",
42374253
"rustc_data_structures",
42384254
"rustc_errors",
4255+
"rustc_index",
42394256
"rustc_lexer",
42404257
"rustc_target",
42414258
"scoped-tls",
@@ -4265,6 +4282,7 @@ dependencies = [
42654282
"arena",
42664283
"cfg-if",
42674284
"rustc_data_structures",
4285+
"rustc_index",
42684286
"rustc_macros",
42694287
"scoped-tls",
42704288
"serialize",

src/librustc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ rustc_apfloat = { path = "../librustc_apfloat" }
2525
rustc_target = { path = "../librustc_target" }
2626
rustc_macros = { path = "../librustc_macros" }
2727
rustc_data_structures = { path = "../librustc_data_structures" }
28+
rustc_index = { path = "../librustc_index" }
2829
errors = { path = "../librustc_errors", package = "rustc_errors" }
2930
rustc_serialize = { path = "../libserialize", package = "serialize" }
3031
syntax = { path = "../libsyntax" }

src/librustc/arena.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ macro_rules! arena_types {
2626
[] steal_mir: rustc::ty::steal::Steal<rustc::mir::Body<$tcx>>,
2727
[] mir: rustc::mir::Body<$tcx>,
2828
[] steal_promoted: rustc::ty::steal::Steal<
29-
rustc_data_structures::indexed_vec::IndexVec<
29+
rustc_index::vec::IndexVec<
3030
rustc::mir::Promoted,
3131
rustc::mir::Body<$tcx>
3232
>
3333
>,
34-
[] promoted: rustc_data_structures::indexed_vec::IndexVec<
34+
[] promoted: rustc_index::vec::IndexVec<
3535
rustc::mir::Promoted,
3636
rustc::mir::Body<$tcx>
3737
>,
@@ -45,7 +45,7 @@ macro_rules! arena_types {
4545
[decode] specialization_graph: rustc::traits::specialization_graph::Graph,
4646
[] region_scope_tree: rustc::middle::region::ScopeTree,
4747
[] item_local_set: rustc::util::nodemap::ItemLocalSet,
48-
[decode] mir_const_qualif: rustc_data_structures::bit_set::BitSet<rustc::mir::Local>,
48+
[decode] mir_const_qualif: rustc_index::bit_set::BitSet<rustc::mir::Local>,
4949
[] trait_impls_of: rustc::ty::trait_def::TraitImpls,
5050
[] dropck_outlives:
5151
rustc::infer::canonical::Canonical<'tcx,

src/librustc/dep_graph/graph.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use errors::Diagnostic;
22
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
33
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
4-
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
4+
use rustc_index::vec::{Idx, IndexVec};
55
use smallvec::SmallVec;
66
use rustc_data_structures::sync::{Lrc, Lock, AtomicU32, Ordering};
77
use std::env;
@@ -26,7 +26,7 @@ pub struct DepGraph {
2626
data: Option<Lrc<DepGraphData>>,
2727
}
2828

29-
newtype_index! {
29+
rustc_index::newtype_index! {
3030
pub struct DepNodeIndex { .. }
3131
}
3232

src/librustc/dep_graph/serialized.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
33
use crate::dep_graph::DepNode;
44
use crate::ich::Fingerprint;
5-
use rustc_data_structures::indexed_vec::{IndexVec, Idx};
5+
use rustc_index::vec::{IndexVec, Idx};
66

7-
newtype_index! {
7+
rustc_index::newtype_index! {
88
pub struct SerializedDepNodeIndex { .. }
99
}
1010

src/librustc/hir/def_id.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::ty::{self, TyCtxt};
2-
use rustc_data_structures::indexed_vec::Idx;
2+
use rustc_index::vec::Idx;
33
use std::fmt;
44
use std::u32;
55

6-
newtype_index! {
6+
rustc_index::newtype_index! {
77
pub struct CrateId {
88
ENCODABLE = custom
99
}
@@ -87,7 +87,7 @@ impl fmt::Display for CrateNum {
8787
impl rustc_serialize::UseSpecializedEncodable for CrateNum {}
8888
impl rustc_serialize::UseSpecializedDecodable for CrateNum {}
8989

90-
newtype_index! {
90+
rustc_index::newtype_index! {
9191
/// A DefIndex is an index into the hir-map for a crate, identifying a
9292
/// particular definition. It should really be considered an interned
9393
/// shorthand for a particular DefPath.

src/librustc/hir/lowering.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use crate::util::common::FN_OUTPUT_NAME;
5252
use crate::util::nodemap::{DefIdMap, NodeMap};
5353
use errors::Applicability;
5454
use rustc_data_structures::fx::FxHashSet;
55-
use rustc_data_structures::indexed_vec::IndexVec;
55+
use rustc_index::vec::IndexVec;
5656
use rustc_data_structures::thin_vec::ThinVec;
5757
use rustc_data_structures::sync::Lrc;
5858

src/librustc/hir/map/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::hir::map::HirEntryMap;
55
use crate::hir::def_id::{LOCAL_CRATE, CrateNum};
66
use crate::hir::intravisit::{Visitor, NestedVisitorMap};
77
use rustc_data_structures::svh::Svh;
8-
use rustc_data_structures::indexed_vec::IndexVec;
8+
use rustc_index::vec::IndexVec;
99
use crate::ich::Fingerprint;
1010
use crate::middle::cstore::CrateStore;
1111
use crate::session::CrateDisambiguator;

src/librustc/hir/map/definitions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::session::CrateDisambiguator;
1111
use crate::util::nodemap::NodeMap;
1212

1313
use rustc_data_structures::fx::FxHashMap;
14-
use rustc_data_structures::indexed_vec::{IndexVec};
14+
use rustc_index::vec::{IndexVec};
1515
use rustc_data_structures::stable_hasher::StableHasher;
1616
use std::borrow::Borrow;
1717
use std::fmt::Write;

src/librustc/hir/map/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::util::common::time;
1717

1818
use rustc_target::spec::abi::Abi;
1919
use rustc_data_structures::svh::Svh;
20-
use rustc_data_structures::indexed_vec::IndexVec;
20+
use rustc_index::vec::IndexVec;
2121
use syntax::ast::{self, Name, NodeId};
2222
use syntax::source_map::Spanned;
2323
use syntax::ext::base::MacroKind;

0 commit comments

Comments
 (0)