aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_arena/src
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-10 21:57:07 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-10 21:57:07 +0000
commit28559b7dd2e2c101c4b7f2c9bb207b3af94f6e16 (patch)
tree7bee8dee5216b7eb459edaa0aad54f04dcef3f97 /crates/ra_arena/src
parentb6bc55f542c88b1b0789435219f9dbf38c110f47 (diff)
parent6b7699d187d51e8a26ba1a18a217a77dd236458f (diff)
Merge #489
489: support std r=matklad a=matklad closes #465 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_arena/src')
-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) => {