diff options
| author | bors <bors@rust-lang.org> | 2019-09-30 13:33:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-09-30 13:33:15 +0000 |
| commit | 22bc9e1d9ca49ee4f5cd953088ab09c238a6dd26 (patch) | |
| tree | 1447e329ac138963f386d612dd9eb78f8a03dafe /src/libsyntax_pos | |
| parent | e0436d912df090b0c3cba9a8b818aab408756e49 (diff) | |
| parent | 64f61c7888c9cb2cbd7d37f87a6cbec2858ee409 (diff) | |
| download | rust-22bc9e1d9ca49ee4f5cd953088ab09c238a6dd26.tar.gz rust-22bc9e1d9ca49ee4f5cd953088ab09c238a6dd26.zip | |
Auto merge of #64778 - csmoe:index, r=eddyb
Introduce librustc_index crate Closes #50592
Diffstat (limited to 'src/libsyntax_pos')
| -rw-r--r-- | src/libsyntax_pos/Cargo.toml | 1 | ||||
| -rw-r--r-- | src/libsyntax_pos/symbol.rs | 11 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax_pos/Cargo.toml b/src/libsyntax_pos/Cargo.toml index bc13d2a1611..378f7a955a3 100644 --- a/src/libsyntax_pos/Cargo.toml +++ b/src/libsyntax_pos/Cargo.toml @@ -13,6 +13,7 @@ doctest = false rustc_serialize = { path = "../libserialize", package = "serialize" } rustc_macros = { path = "../librustc_macros" } rustc_data_structures = { path = "../librustc_data_structures" } +rustc_index = { path = "../librustc_index" } arena = { path = "../libarena" } scoped-tls = "1.0" unicode-width = "0.1.4" diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs index 44a34070dec..1769135e7f2 100644 --- a/src/libsyntax_pos/symbol.rs +++ b/src/libsyntax_pos/symbol.rs @@ -4,8 +4,7 @@ use arena::DroplessArena; use rustc_data_structures::fx::FxHashMap; -use rustc_data_structures::indexed_vec::Idx; -use rustc_data_structures::newtype_index; +use rustc_index::vec::Idx; use rustc_macros::symbols; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use rustc_serialize::{UseSpecializedDecodable, UseSpecializedEncodable}; @@ -897,15 +896,15 @@ impl UseSpecializedDecodable for Ident { /// ``` /// Internally, a symbol is implemented as an index, and all operations /// (including hashing, equality, and ordering) operate on that index. The use -/// of `newtype_index!` means that `Option<Symbol>` only takes up 4 bytes, -/// because `newtype_index!` reserves the last 256 values for tagging purposes. +/// of `rustc_index::newtype_index!` means that `Option<Symbol>` only takes up 4 bytes, +/// because `rustc_index::newtype_index!` reserves the last 256 values for tagging purposes. /// -/// Note that `Symbol` cannot directly be a `newtype_index!` because it +/// Note that `Symbol` cannot directly be a `rustc_index::newtype_index!` because it /// implements `fmt::Debug`, `Encodable`, and `Decodable` in special ways. #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Symbol(SymbolIndex); -newtype_index! { +rustc_index::newtype_index! { pub struct SymbolIndex { .. } } |
