Skip to content

Commit 87004db

Browse files
committed
auto merge of #11867 : dmanescu/rust/8784-arena-glob, r=huonw
In line with the dissolution of libextra - #8784 - this moves arena and glob into their own respective modules. Updates .gitignore with the entries doc/{arena,glob} in accordance.
2 parents 7b1432f + 93398d1 commit 87004db

File tree

14 files changed

+39
-21
lines changed

14 files changed

+39
-21
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ src/.DS_Store
7474
/doc/html
7575
/doc/latex
7676
/doc/std
77+
/doc/arena
7778
/doc/extra
7879
/doc/flate
80+
/doc/glob
7981
/doc/green
8082
/doc/native
8183
/doc/rustc

doc/index.md

+2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ 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)
42+
* [The `glob` file path matching library](glob/index.html)
4143

4244
# Tooling
4345

mk/crates.mk

+4-2
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 glob
5353
HOST_CRATES := syntax rustc rustdoc rustpkg
5454
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5555
TOOLS := compiletest rustpkg rustdoc rustc
@@ -60,10 +60,12 @@ 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
68+
DEPS_glob := std
6769

6870
TOOL_DEPS_compiletest := extra green rustuv
6971
TOOL_DEPS_rustpkg := rustpkg green rustuv

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

+10-3
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

-2
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,8 @@ pub mod ebml;
6767
pub mod getopts;
6868
pub mod json;
6969
pub mod tempfile;
70-
pub mod glob;
7170
pub mod term;
7271
pub mod time;
73-
pub mod arena;
7472
pub mod base64;
7573
pub mod workcache;
7674
pub mod enum_set;

src/libextra/glob.rs renamed to src/libglob/lib.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
* `glob`/`fnmatch` functions.
2424
*/
2525

26+
#[crate_id = "glob#0.10-pre"];
27+
#[crate_type = "rlib"];
28+
#[crate_type = "dylib"];
29+
#[license = "MIT/ASL2"];
30+
2631
use std::{os, path};
2732
use std::io;
2833
use std::io::fs;
@@ -53,7 +58,7 @@ pub struct Paths {
5358
/// `puppies.jpg` and `hamsters.gif`:
5459
///
5560
/// ```rust
56-
/// use extra::glob::glob;
61+
/// use glob::glob;
5762
///
5863
/// for path in glob("/media/pictures/*.jpg") {
5964
/// println!("{}", path.display());
@@ -297,7 +302,7 @@ impl Pattern {
297302
* # Example
298303
*
299304
* ```rust
300-
* use extra::glob::Pattern;
305+
* use glob::Pattern;
301306
*
302307
* assert!(Pattern::new("c?t").matches("cat"));
303308
* assert!(Pattern::new("k[!e]tteh").matches("kitteh"));
@@ -537,7 +542,7 @@ impl MatchOptions {
537542
#[cfg(test)]
538543
mod test {
539544
use std::os;
540-
use super::*;
545+
use super::{glob, Pattern, MatchOptions};
541546

542547
#[test]
543548
fn test_absolute_pattern() {

src/librustc/lib.rs

+1
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

+1-1
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

+1-1
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

+2-2
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

+2-1
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/glob-std.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
// xfail-win32 TempDir may cause IoError on windows: #10462
1313

1414
extern mod extra;
15+
extern mod glob;
1516

16-
use extra::glob::glob;
17+
use glob::glob;
1718
use extra::tempfile::TempDir;
1819
use std::unstable::finally::Finally;
1920
use std::{os, unstable};

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

+2-2
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

+2-3
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)