Skip to content

Commit 4d0d3da

Browse files
committed
extra: move arena to libarena
In line with the dissolution of libextra - #8784 - moves arena to its own library libarena. Changes based on PR #11787. Updates .gitignore to ignore doc/arena.
1 parent edfb546 commit 4d0d3da

File tree

12 files changed

+26
-16
lines changed

12 files changed

+26
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ src/.DS_Store
7474
/doc/html
7575
/doc/latex
7676
/doc/std
77+
/doc/arena
7778
/doc/extra
7879
/doc/flate
7980
/doc/green

doc/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ li {list-style-type: none; }
3737
* [The Rust parser, `libsyntax`](syntax/index.html)
3838
* [The Rust compiler, `librustc`](rustc/index.html)
3939

40+
* [The `arena` allocation library](arena/index.html)
4041
* [The `flate` compression library](flate/index.html)
4142

4243
# Tooling

mk/crates.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := std extra green rustuv native flate
52+
TARGET_CRATES := std extra green rustuv native flate arena
5353
HOST_CRATES := syntax rustc rustdoc rustpkg
5454
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5555
TOOLS := compiletest rustpkg rustdoc rustc
@@ -60,10 +60,11 @@ DEPS_green := std
6060
DEPS_rustuv := std native:uv native:uv_support
6161
DEPS_native := std
6262
DEPS_syntax := std extra
63-
DEPS_rustc := syntax native:rustllvm flate
63+
DEPS_rustc := syntax native:rustllvm flate arena
6464
DEPS_rustdoc := rustc native:sundown
6565
DEPS_rustpkg := rustc
6666
DEPS_flate := std native:miniz
67+
DEPS_arena := std extra
6768

6869
TOOL_DEPS_compiletest := extra green rustuv
6970
TOOL_DEPS_rustpkg := rustpkg green rustuv

src/libextra/arena.rs renamed to src/libarena/lib.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,17 @@
1515
//! of individual objects while the arena itself is still alive. The benefit
1616
//! of an arena is very fast allocation; just a pointer bump.
1717
18+
#[crate_id = "arena#0.10-pre"];
19+
#[crate_type = "rlib"];
20+
#[crate_type = "dylib"];
21+
#[license = "MIT/ASL2"];
1822
#[allow(missing_doc)];
23+
#[feature(managed_boxes)];
1924

20-
use list::{List, Cons, Nil};
21-
use list;
25+
extern mod extra;
26+
27+
use extra::list::{List, Cons, Nil};
28+
use extra::list;
2229

2330
use std::at_vec;
2431
use std::cast::{transmute, transmute_mut, transmute_mut_region};
@@ -493,7 +500,7 @@ impl<T> Drop for TypedArena<T> {
493500
#[cfg(test)]
494501
mod test {
495502
use super::{Arena, TypedArena};
496-
use test::BenchHarness;
503+
use extra::test::BenchHarness;
497504

498505
struct Point {
499506
x: int,

src/libextra/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ pub mod tempfile;
7070
pub mod glob;
7171
pub mod term;
7272
pub mod time;
73-
pub mod arena;
7473
pub mod base64;
7574
pub mod workcache;
7675
pub mod enum_set;

src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ This API is completely unstable and subject to change.
3131

3232
extern mod extra;
3333
extern mod flate;
34+
extern mod arena;
3435
extern mod syntax;
3536

3637
use back::link;

src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ use util::common::indenter;
6868
use util::ppaux::{Repr, ty_to_str};
6969
use util::sha2::Sha256;
7070

71-
use extra::arena::TypedArena;
71+
use arena::TypedArena;
7272
use extra::time;
7373
use std::c_str::ToCStr;
7474
use std::cell::{Cell, RefCell};

src/librustc/middle/trans/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use middle::typeck;
3131
use util::ppaux::Repr;
3232

3333

34-
use extra::arena::TypedArena;
34+
use arena::TypedArena;
3535
use std::c_str::ToCStr;
3636
use std::cast::transmute;
3737
use std::cast;

src/librustc/middle/typeck/variance.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ represents the "variance transform" as defined in the paper:
193193
*/
194194

195195
use std::hashmap::HashMap;
196-
use extra::arena;
197-
use extra::arena::Arena;
196+
use arena;
197+
use arena::Arena;
198198
use middle::ty;
199199
use std::vec;
200200
use syntax::ast;

src/test/bench/shootout-binarytrees.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
// except according to those terms.
1010

1111
extern mod extra;
12+
extern mod arena;
1213

1314
use std::iter::range_step;
1415
use extra::future::Future;
15-
use extra::arena::TypedArena;
16+
use arena::TypedArena;
1617

1718
enum Tree<'a> {
1819
Nil,

src/test/run-pass/placement-new-arena.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
// option. This file may not be copied, modified, or distributed
1111
// except according to those terms.
1212

13-
extern mod extra;
14-
use extra::arena::Arena;
13+
extern mod arena;
14+
use arena::Arena;
1515

1616
pub fn main() {
1717
let mut arena = Arena::new();

src/test/run-pass/regions-mock-tcx.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
// - Multiple lifetime parameters
1717
// - Arenas
1818

19-
extern mod extra;
19+
extern mod arena;
2020

21-
use extra::arena;
22-
use extra::arena::Arena;
21+
use arena::Arena;
2322
use std::hashmap::HashMap;
2423
use std::cast;
2524
use std::libc;

0 commit comments

Comments
 (0)