Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra: move arena and glob to libarena and libglob #11867

Merged
merged 2 commits into from
Jan 29, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ src/.DS_Store
/doc/html
/doc/latex
/doc/std
/doc/arena
/doc/extra
/doc/flate
/doc/glob
/doc/green
/doc/native
/doc/rustc
Expand Down
2 changes: 2 additions & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ li {list-style-type: none; }
* [The Rust parser, `libsyntax`](syntax/index.html)
* [The Rust compiler, `librustc`](rustc/index.html)

* [The `arena` allocation library](arena/index.html)
* [The `flate` compression library](flate/index.html)
* [The `glob` file path matching library](glob/index.html)

# Tooling

Expand Down
6 changes: 4 additions & 2 deletions mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# automatically generated for all stage/host/target combinations.
################################################################################

TARGET_CRATES := std extra green rustuv native flate
TARGET_CRATES := std extra green rustuv native flate arena glob
HOST_CRATES := syntax rustc rustdoc rustpkg
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
TOOLS := compiletest rustpkg rustdoc rustc
Expand All @@ -60,10 +60,12 @@ DEPS_green := std
DEPS_rustuv := std native:uv native:uv_support
DEPS_native := std
DEPS_syntax := std extra
DEPS_rustc := syntax native:rustllvm flate
DEPS_rustc := syntax native:rustllvm flate arena
DEPS_rustdoc := rustc native:sundown
DEPS_rustpkg := rustc
DEPS_flate := std native:miniz
DEPS_arena := std extra
DEPS_glob := std

TOOL_DEPS_compiletest := extra green rustuv
TOOL_DEPS_rustpkg := rustpkg green rustuv
Expand Down
13 changes: 10 additions & 3 deletions src/libextra/arena.rs → src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@
//! of individual objects while the arena itself is still alive. The benefit
//! of an arena is very fast allocation; just a pointer bump.

#[crate_id = "arena#0.10-pre"];
#[crate_type = "rlib"];
#[crate_type = "dylib"];
#[license = "MIT/ASL2"];
#[allow(missing_doc)];
#[feature(managed_boxes)];

use list::{List, Cons, Nil};
use list;
extern mod extra;

use extra::list::{List, Cons, Nil};
use extra::list;

use std::at_vec;
use std::cast::{transmute, transmute_mut, transmute_mut_region};
Expand Down Expand Up @@ -493,7 +500,7 @@ impl<T> Drop for TypedArena<T> {
#[cfg(test)]
mod test {
use super::{Arena, TypedArena};
use test::BenchHarness;
use extra::test::BenchHarness;

struct Point {
x: int,
Expand Down
2 changes: 0 additions & 2 deletions src/libextra/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ pub mod ebml;
pub mod getopts;
pub mod json;
pub mod tempfile;
pub mod glob;
pub mod term;
pub mod time;
pub mod arena;
pub mod base64;
pub mod workcache;
pub mod enum_set;
Expand Down
11 changes: 8 additions & 3 deletions src/libextra/glob.rs → src/libglob/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
* `glob`/`fnmatch` functions.
*/

#[crate_id = "glob#0.10-pre"];
#[crate_type = "rlib"];
#[crate_type = "dylib"];
#[license = "MIT/ASL2"];

use std::{os, path};
use std::io;
use std::io::fs;
Expand Down Expand Up @@ -53,7 +58,7 @@ pub struct Paths {
/// `puppies.jpg` and `hamsters.gif`:
///
/// ```rust
/// use extra::glob::glob;
/// use glob::glob;
///
/// for path in glob("/media/pictures/*.jpg") {
/// println!("{}", path.display());
Expand Down Expand Up @@ -297,7 +302,7 @@ impl Pattern {
* # Example
*
* ```rust
* use extra::glob::Pattern;
* use glob::Pattern;
*
* assert!(Pattern::new("c?t").matches("cat"));
* assert!(Pattern::new("k[!e]tteh").matches("kitteh"));
Expand Down Expand Up @@ -537,7 +542,7 @@ impl MatchOptions {
#[cfg(test)]
mod test {
use std::os;
use super::*;
use super::{glob, Pattern, MatchOptions};

#[test]
fn test_absolute_pattern() {
Expand Down
1 change: 1 addition & 0 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ This API is completely unstable and subject to change.

extern mod extra;
extern mod flate;
extern mod arena;
extern mod syntax;

use back::link;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ use util::common::indenter;
use util::ppaux::{Repr, ty_to_str};
use util::sha2::Sha256;

use extra::arena::TypedArena;
use arena::TypedArena;
use extra::time;
use std::c_str::ToCStr;
use std::cell::{Cell, RefCell};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use middle::typeck;
use util::ppaux::Repr;


use extra::arena::TypedArena;
use arena::TypedArena;
use std::c_str::ToCStr;
use std::cast::transmute;
use std::cast;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/typeck/variance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ represents the "variance transform" as defined in the paper:
*/

use std::hashmap::HashMap;
use extra::arena;
use extra::arena::Arena;
use arena;
use arena::Arena;
use middle::ty;
use std::vec;
use syntax::ast;
Expand Down
3 changes: 2 additions & 1 deletion src/test/bench/shootout-binarytrees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
// except according to those terms.

extern mod extra;
extern mod arena;

use std::iter::range_step;
use extra::future::Future;
use extra::arena::TypedArena;
use arena::TypedArena;

enum Tree<'a> {
Nil,
Expand Down
3 changes: 2 additions & 1 deletion src/test/run-pass/glob-std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
// xfail-win32 TempDir may cause IoError on windows: #10462

extern mod extra;
extern mod glob;

use extra::glob::glob;
use glob::glob;
use extra::tempfile::TempDir;
use std::unstable::finally::Finally;
use std::{os, unstable};
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-pass/placement-new-arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

extern mod extra;
use extra::arena::Arena;
extern mod arena;
use arena::Arena;

pub fn main() {
let mut arena = Arena::new();
Expand Down
5 changes: 2 additions & 3 deletions src/test/run-pass/regions-mock-tcx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
// - Multiple lifetime parameters
// - Arenas

extern mod extra;
extern mod arena;

use extra::arena;
use extra::arena::Arena;
use arena::Arena;
use std::hashmap::HashMap;
use std::cast;
use std::libc;
Expand Down