aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_arena
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-10 19:47:05 +0000
committerAleksey Kladov <[email protected]>2019-01-10 21:51:34 +0000
commit8852408bfb358766d59b83f294148fb5eeae26a0 (patch)
tree1bca8af9f6ac8f668d8ca5a710b6677c6b90e921 /crates/ra_arena
parent66fba88534039ff42a230f1ede3e0a730f61ad3c (diff)
use arena for sysroot
Diffstat (limited to 'crates/ra_arena')
-rw-r--r--crates/ra_arena/src/lib.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_arena/src/lib.rs b/crates/ra_arena/src/lib.rs
index 43bfa925a..d7d5d5265 100644
--- a/crates/ra_arena/src/lib.rs
+++ b/crates/ra_arena/src/lib.rs
@@ -35,12 +35,21 @@ impl fmt::Display for RawId {
35 } 35 }
36} 36}
37 37
38#[derive(Clone, Debug, PartialEq, Eq)] 38#[derive(Clone, PartialEq, Eq)]
39pub struct Arena<ID: ArenaId, T> { 39pub struct Arena<ID: ArenaId, T> {
40 data: Vec<T>, 40 data: Vec<T>,
41 _ty: PhantomData<ID>, 41 _ty: PhantomData<ID>,
42} 42}
43 43
44impl<ID: ArenaId, T: fmt::Debug> fmt::Debug for Arena<ID, T> {
45 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
46 fmt.debug_struct("Arena")
47 .field("len", &self.len())
48 .field("data", &self.data)
49 .finish()
50 }
51}
52
44#[macro_export] 53#[macro_export]
45macro_rules! impl_arena_id { 54macro_rules! impl_arena_id {
46 ($name:ident) => { 55 ($name:ident) => {