From 58e4ab2b33f559107dbdfa9d3cab882cf8029481 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 14 Mar 2014 11:16:10 -0700 Subject: [PATCH] extra: Put the nail in the coffin, delete libextra This commit shreds all remnants of libextra from the compiler and standard distribution. Two modules, c_vec/tempfile, were moved into libstd after some cleanup, and the other modules were moved to separate crates as seen fit. Closes #8784 Closes #12413 Closes #12576 --- mk/crates.mk | 16 +- src/doc/index.md | 2 + src/doc/rust.md | 4 +- src/doc/tutorial.md | 11 - src/etc/combine-tests.py | 2 - src/etc/generate-deriving-span-tests.py | 1 - src/libextra/c_vec.rs | 240 ---------------- src/libextra/lib.rs | 52 ---- src/libextra/unicode.rs | 262 ------------------ src/libflate/lib.rs | 4 +- src/librustc/back/archive.rs | 3 +- src/librustc/back/link.rs | 4 +- src/librustc/lib.rs | 1 - src/librustc/metadata/cstore.rs | 2 +- src/librustdoc/lib.rs | 1 - src/librustdoc/test.rs | 6 +- src/libstd/c_vec.rs | 216 +++++++++++++++ src/libstd/io/mod.rs | 29 +- src/{libextra => libstd/io}/tempfile.rs | 27 +- src/libstd/lib.rs | 4 +- src/libstd/os.rs | 1 - src/libsyntax/parse/parser.rs | 2 +- src/libtest/lib.rs | 12 +- src/{libextra => libtest}/stats.rs | 7 +- src/{libextra/url.rs => liburl/lib.rs} | 24 +- .../workcache.rs => libworkcache/lib.rs} | 11 +- src/test/auxiliary/issue-2526.rs | 2 - src/test/auxiliary/issue-2631-a.rs | 1 - src/test/bench/rt-messaging-ping-pong.rs | 2 - src/test/bench/rt-parfib.rs | 2 - src/test/bench/rt-spawn-rate.rs | 2 - src/test/bench/shootout-ackermann.rs | 2 - src/test/bench/shootout-chameneos-redux.rs | 2 - src/test/bench/shootout-fibo.rs | 2 - src/test/bench/shootout-k-nucleotide-pipes.rs | 1 - src/test/bench/sudoku.rs | 2 - ...deriving-span-Clone-enum-struct-variant.rs | 1 - .../compile-fail/deriving-span-Clone-enum.rs | 1 - .../deriving-span-Clone-struct.rs | 1 - .../deriving-span-Clone-tuple-struct.rs | 1 - .../deriving-span-Default-struct.rs | 1 - .../deriving-span-Default-tuple-struct.rs | 1 - .../deriving-span-Eq-enum-struct-variant.rs | 1 - .../compile-fail/deriving-span-Eq-enum.rs | 1 - .../compile-fail/deriving-span-Eq-struct.rs | 1 - .../deriving-span-Eq-tuple-struct.rs | 1 - .../deriving-span-Hash-enum-struct-variant.rs | 1 - .../compile-fail/deriving-span-Hash-enum.rs | 1 - .../compile-fail/deriving-span-Hash-struct.rs | 1 - .../deriving-span-Hash-tuple-struct.rs | 1 - .../deriving-span-Ord-enum-struct-variant.rs | 1 - .../compile-fail/deriving-span-Ord-enum.rs | 1 - .../compile-fail/deriving-span-Ord-struct.rs | 1 - .../deriving-span-Ord-tuple-struct.rs | 1 - .../deriving-span-Rand-enum-struct-variant.rs | 1 - .../compile-fail/deriving-span-Rand-enum.rs | 1 - .../compile-fail/deriving-span-Rand-struct.rs | 1 - .../deriving-span-Rand-tuple-struct.rs | 1 - .../deriving-span-Show-enum-struct-variant.rs | 1 - .../compile-fail/deriving-span-Show-enum.rs | 1 - .../compile-fail/deriving-span-Show-struct.rs | 1 - .../deriving-span-Show-tuple-struct.rs | 1 - ...riving-span-TotalEq-enum-struct-variant.rs | 1 - .../deriving-span-TotalEq-enum.rs | 1 - .../deriving-span-TotalEq-struct.rs | 1 - .../deriving-span-TotalEq-tuple-struct.rs | 1 - ...iving-span-TotalOrd-enum-struct-variant.rs | 1 - .../deriving-span-TotalOrd-enum.rs | 1 - .../deriving-span-TotalOrd-struct.rs | 1 - .../deriving-span-TotalOrd-tuple-struct.rs | 1 - .../compile-fail/deriving-span-Zero-struct.rs | 1 - .../deriving-span-Zero-tuple-struct.rs | 1 - src/test/compile-fail/issue-3021-b.rs | 2 - src/test/compile-fail/issue-3021-c.rs | 2 - src/test/compile-fail/issue-3021-d.rs | 2 - src/test/compile-fail/issue-3021.rs | 2 - ...s-based-on-type-cyclic-types-issue-4821.rs | 2 - src/test/compile-fail/pattern-tyvar-2.rs | 2 - src/test/compile-fail/pattern-tyvar.rs | 2 - src/test/compile-fail/qquote-1.rs | 1 - src/test/compile-fail/qquote-2.rs | 3 - .../compile-fail/regions-glb-free-free.rs | 2 - src/test/compile-fail/seq-args.rs | 1 - src/test/compile-fail/spawn-non-nil-fn.rs | 2 - .../unresolved-extern-mod-suggestion.rs | 4 +- src/test/compile-fail/view-items-at-top.rs | 4 +- src/test/run-fail/fail-main.rs | 1 - src/test/run-fail/fmt-fail.rs | 1 - src/test/run-fail/for-each-loop-fail.rs | 1 - src/test/run-fail/morestack2.rs | 2 - src/test/run-fail/morestack3.rs | 2 - src/test/run-fail/morestack4.rs | 2 - src/test/run-fail/run-unexported-tests.rs | 2 - src/test/run-pass-fulldeps/qquote.rs | 1 - src/test/run-pass/attr-before-view-item.rs | 2 +- src/test/run-pass/attr-before-view-item2.rs | 2 +- src/test/run-pass/block-arg-call-as.rs | 2 - src/test/run-pass/clone-with-exterior.rs | 1 - src/test/run-pass/explicit-self-generic.rs | 2 - src/test/run-pass/extern-foreign-crate.rs | 1 - src/test/run-pass/float-nan.rs | 2 - src/test/run-pass/foreign-fn-linkname.rs | 2 - src/test/run-pass/glob-std.rs | 3 +- src/test/run-pass/import-glob-crate.rs | 1 - src/test/run-pass/infinite-loops.rs | 2 - src/test/run-pass/intrinsics-integer.rs | 2 - src/test/run-pass/issue-2904.rs | 2 - src/test/run-pass/issue-2989.rs | 2 - src/test/run-pass/issue-3424.rs | 1 - src/test/run-pass/issue-3556.rs | 2 - src/test/run-pass/issue-3563-3.rs | 1 - src/test/run-pass/issue-3574.rs | 1 - src/test/run-pass/issue-3609.rs | 2 - src/test/run-pass/item-attributes.rs | 4 +- src/test/run-pass/match-join.rs | 3 - ...nomorphized-callees-with-ty-params-3314.rs | 2 - src/test/run-pass/morestack5.rs | 2 - src/test/run-pass/move-3-unique.rs | 2 - src/test/run-pass/move-3.rs | 2 - src/test/run-pass/move-4-unique.rs | 2 - src/test/run-pass/move-4.rs | 2 - src/test/run-pass/mutable-alias-vec.rs | 2 - src/test/run-pass/preempt.rs | 3 - ...-lifetime-static-items-enclosing-scopes.rs | 1 - src/test/run-pass/rename-directory.rs | 3 +- src/test/run-pass/spawn.rs | 2 - src/test/run-pass/stat.rs | 7 +- src/test/run-pass/str-append.rs | 4 - src/test/run-pass/str-multiline.rs | 4 - src/test/run-pass/string-self-append.rs | 2 - src/test/run-pass/task-comm-0.rs | 2 - src/test/run-pass/task-comm-10.rs | 2 - src/test/run-pass/task-comm-11.rs | 2 - src/test/run-pass/task-comm-12.rs | 2 - src/test/run-pass/task-comm-13.rs | 2 - src/test/run-pass/task-comm-15.rs | 2 - src/test/run-pass/task-comm-17.rs | 2 - src/test/run-pass/task-comm-3.rs | 2 - src/test/run-pass/task-comm-5.rs | 2 - src/test/run-pass/task-comm-7.rs | 2 - src/test/run-pass/task-comm-9.rs | 2 - src/test/run-pass/task-comm-chan-nil.rs | 3 - src/test/run-pass/task-life-0.rs | 2 - src/test/run-pass/tempfile.rs | 5 +- src/test/run-pass/terminate-in-initializer.rs | 2 - src/test/run-pass/test-ignore-cfg.rs | 2 - src/test/run-pass/test-runner-hides-main.rs | 2 - src/test/run-pass/threads.rs | 2 - src/test/run-pass/trait-inheritance-num.rs | 2 - src/test/run-pass/trait-inheritance-num2.rs | 2 - src/test/run-pass/unify-return-ty.rs | 1 - src/test/run-pass/unwind-box.rs | 2 - src/test/run-pass/unwind-resource.rs | 2 - src/test/run-pass/unwind-resource2.rs | 2 - src/test/run-pass/unwind-unique.rs | 2 - src/test/run-pass/use-crate-name-alias.rs | 2 +- src/test/run-pass/utf8_chars.rs | 2 - src/test/run-pass/vec-self-append.rs | 2 - 158 files changed, 311 insertions(+), 869 deletions(-) delete mode 100644 src/libextra/c_vec.rs delete mode 100644 src/libextra/lib.rs delete mode 100644 src/libextra/unicode.rs create mode 100644 src/libstd/c_vec.rs rename src/{libextra => libstd/io}/tempfile.rs (80%) rename src/{libextra => libtest}/stats.rs (99%) rename src/{libextra/url.rs => liburl/lib.rs} (98%) rename src/{libextra/workcache.rs => libworkcache/lib.rs} (98%) diff --git a/mk/crates.mk b/mk/crates.mk index 16485b9e6b5..2a6e38a6d3d 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -37,7 +37,7 @@ # # DEPS_ # These lists are the dependencies of the that is to be built. -# Rust dependencies are listed bare (i.e. std, extra, green) and native +# Rust dependencies are listed bare (i.e. std, green) and native # dependencies have a "native:" prefix (i.e. native:sundown). All deps # will be built before the crate itself is built. # @@ -49,23 +49,23 @@ # automatically generated for all stage/host/target combinations. ################################################################################ -TARGET_CRATES := std extra green rustuv native flate arena glob term semver \ - uuid serialize sync getopts collections num test time rand +TARGET_CRATES := std green rustuv native flate arena glob term semver \ + uuid serialize sync getopts collections num test time rand \ + workcache url HOST_CRATES := syntax rustc rustdoc fourcc hexfloat CRATES := $(TARGET_CRATES) $(HOST_CRATES) TOOLS := compiletest rustdoc rustc DEPS_std := native:rustrt native:compiler-rt native:backtrace -DEPS_extra := std term sync serialize getopts collections time rand DEPS_green := std rand native:context_switch DEPS_rustuv := std native:uv native:uv_support DEPS_native := std DEPS_syntax := std term serialize collections DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \ - collections time extra + collections time DEPS_rustdoc := rustc native:sundown serialize sync getopts collections \ test time -DEPS_flate := std extra native:miniz +DEPS_flate := std native:miniz DEPS_arena := std collections DEPS_glob := std DEPS_serialize := std collections @@ -78,9 +78,11 @@ DEPS_collections := std rand DEPS_fourcc := syntax std DEPS_hexfloat := syntax std DEPS_num := std rand -DEPS_test := std extra collections getopts serialize term +DEPS_test := std collections getopts serialize term time DEPS_time := std serialize DEPS_rand := std +DEPS_url := std collections +DEPS_workcache := std serialize collections std TOOL_DEPS_compiletest := test green rustuv getopts TOOL_DEPS_rustdoc := rustdoc native diff --git a/src/doc/index.md b/src/doc/index.md index 748f3ffb2dc..6ffb7549c39 100644 --- a/src/doc/index.md +++ b/src/doc/index.md @@ -49,6 +49,8 @@ li {list-style-type: none; } * [The `test` library containing the unit-testing & micro-benchmark framework](test/index.html) * [The `time` library](time/index.html) * [The `uuid` 128-bit universally unique identifier library](uuid/index.html) +* [The `url` library](url/index.html) +* [The `workcache` library](workcache/index.html) # Tooling diff --git a/src/doc/rust.md b/src/doc/rust.md index 9e2b934d0ab..f0b9a430771 100644 --- a/src/doc/rust.md +++ b/src/doc/rust.md @@ -787,9 +787,9 @@ Four examples of `extern crate` declarations: ~~~~ {.ignore} extern crate pcre; -extern crate extra; // equivalent to: extern crate extra = "extra"; +extern crate std; // equivalent to: extern crate std = "std"; -extern crate rustextra = "extra"; // linking to 'extra' under another name +extern crate ruststd = "std"; // linking to 'std' under another name extern crate foo = "some/where/rust-foo#foo:1.0"; // a full package ID for external tools ~~~~ diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index 15fd21e9fbc..9b4d4444da4 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -3228,17 +3228,6 @@ See the [API documentation][stddoc] for details. [stddoc]: std/index.html -## The extra library - -Rust ships with crates such as the [extra library], an accumulation of useful things, -that are however not important enough to deserve a place in the standard -library. You can link to a library such as `extra` with an `extern crate extra;`. - -[extra library]: extra/index.html - -Right now `extra` contains those definitions directly, but in the future it will likely just -re-export a bunch of 'officially blessed' crates that get managed with a package manager. - # What next? Now that you know the essentials, check out any of the additional diff --git a/src/etc/combine-tests.py b/src/etc/combine-tests.py index 2590db56d0a..a7f23405de5 100755 --- a/src/etc/combine-tests.py +++ b/src/etc/combine-tests.py @@ -56,7 +56,6 @@ c.write( #[feature(globs, macro_rules, struct_variant, managed_boxes)]; #[allow(warnings)]; extern crate collections; -extern crate extra; """ ) for t in stage2_tests: @@ -73,7 +72,6 @@ d.write( """ // AUTO-GENERATED FILE: DO NOT EDIT #[feature(globs, managed_boxes)]; -extern crate extra; extern crate run_pass_stage2; use run_pass_stage2::*; use std::io; diff --git a/src/etc/generate-deriving-span-tests.py b/src/etc/generate-deriving-span-tests.py index 260c1c89124..05ce884dfb1 100755 --- a/src/etc/generate-deriving-span-tests.py +++ b/src/etc/generate-deriving-span-tests.py @@ -38,7 +38,6 @@ TEMPLATE = """// Copyright {year} The Rust Project Developers. See the COPYRIGHT // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; {error_deriving} diff --git a/src/libextra/c_vec.rs b/src/libextra/c_vec.rs deleted file mode 100644 index b93ffce636b..00000000000 --- a/src/libextra/c_vec.rs +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -/*! - * Library to interface with chunks of memory allocated in C. - * - * It is often desirable to safely interface with memory allocated from C, - * encapsulating the unsafety into allocation and destruction time. Indeed, - * allocating memory externally is currently the only way to give Rust shared - * mut state with C programs that keep their own references; vectors are - * unsuitable because they could be reallocated or moved at any time, and - * importing C memory into a vector takes a one-time snapshot of the memory. - * - * This module simplifies the usage of such external blocks of memory. Memory - * is encapsulated into an opaque object after creation; the lifecycle of the - * memory can be optionally managed by Rust, if an appropriate destructor - * closure is provided. Safety is ensured by bounds-checking accesses, which - * are marshalled through get and set functions. - * - * There are three unsafe functions: the two constructors, and the - * unwrap method. The constructors are unsafe for the - * obvious reason (they act on a pointer that cannot be checked inside the - * method), but `unwrap()` is somewhat more subtle in its unsafety. - * It returns the contained pointer, but at the same time destroys the CVec - * without running its destructor. This can be used to pass memory back to - * C, but care must be taken that the ownership of underlying resources are - * handled correctly, i.e. that allocated memory is eventually freed - * if necessary. - */ - -use std::cast; -use std::ptr; -use std::raw; - -/** - * The type representing a foreign chunk of memory - */ -pub struct CVec { - priv base: *mut T, - priv len: uint, - priv rsrc: DtorRes, -} - -struct DtorRes { - dtor: Option, -} - -#[unsafe_destructor] -impl Drop for DtorRes { - fn drop(&mut self) { - let dtor = self.dtor.take(); - match dtor { - None => (), - Some(f) => f() - } - } -} - -impl DtorRes { - fn new(dtor: Option) -> DtorRes { - DtorRes { - dtor: dtor, - } - } -} - -impl CVec { - /** - * Create a `CVec` from a raw pointer to a buffer with a given length. - * - * Fails if the given pointer is null. - * - * # Arguments - * - * * base - A raw pointer to a buffer - * * len - The number of elements in the buffer - */ - pub unsafe fn new(base: *mut T, len: uint) -> CVec { - assert!(base != ptr::mut_null()); - CVec { - base: base, - len: len, - rsrc: DtorRes::new(None) - } - } - - /** - * Create a `CVec` from a foreign buffer, with a given length, - * and a function to run upon destruction. - * - * Fails if the given pointer is null. - * - * # Arguments - * - * * base - A foreign pointer to a buffer - * * len - The number of elements in the buffer - * * dtor - A proc to run when the value is destructed, useful - * for freeing the buffer, etc. - */ - pub unsafe fn new_with_dtor(base: *mut T, len: uint, dtor: proc()) -> CVec { - assert!(base != ptr::mut_null()); - CVec { - base: base, - len: len, - rsrc: DtorRes::new(Some(dtor)) - } - } - - /// View the stored data as a slice. - pub fn as_slice<'a>(&'a self) -> &'a [T] { - unsafe { - cast::transmute(raw::Slice { data: self.base as *T, len: self.len }) - } - } - - /// View the stored data as a mutable slice. - pub fn as_mut_slice<'a>(&'a mut self) -> &'a mut [T] { - unsafe { - cast::transmute(raw::Slice { data: self.base as *T, len: self.len }) - } - } - - /** - * Retrieves an element at a given index - * - * Fails if `ofs` is greater or equal to the length of the vector - */ - pub fn get<'a>(&'a self, ofs: uint) -> &'a T { - assert!(ofs < self.len); - unsafe { - &*self.base.offset(ofs as int) - } - } - - /** - * Retrieves a mutable element at a given index - * - * Fails if `ofs` is greater or equal to the length of the vector - */ - pub fn get_mut<'a>(&'a mut self, ofs: uint) -> &'a mut T { - assert!(ofs < self.len); - unsafe { - &mut *self.base.offset(ofs as int) - } - } - - /** - * Unwrap the pointer without running the destructor - * - * This method retrieves the underlying pointer, and in the process - * destroys the CVec but without running the destructor. A use case - * would be transferring ownership of the buffer to a C function, as - * in this case you would not want to run the destructor. - * - * Note that if you want to access the underlying pointer without - * cancelling the destructor, you can simply call `transmute` on the return - * value of `get(0)`. - */ - pub unsafe fn unwrap(mut self) -> *mut T { - self.rsrc.dtor = None; - self.base - } -} - -impl Container for CVec { - /// Returns the length of the vector - fn len(&self) -> uint { self.len } -} - -#[cfg(test)] -mod tests { - use super::*; - - use std::libc::*; - use std::libc; - use std::ptr; - use std::rt::global_heap::malloc_raw; - - fn malloc(n: uint) -> CVec { - unsafe { - let mem = malloc_raw(n); - - CVec::new_with_dtor(mem as *mut u8, n, - proc() { libc::free(mem as *mut c_void); }) - } - } - - #[test] - fn test_basic() { - let mut cv = malloc(16); - - *cv.get_mut(3) = 8; - *cv.get_mut(4) = 9; - assert_eq!(*cv.get(3), 8); - assert_eq!(*cv.get(4), 9); - assert_eq!(cv.len(), 16); - } - - #[test] - #[should_fail] - fn test_fail_at_null() { - unsafe { - CVec::new(ptr::mut_null::(), 9); - } - } - - #[test] - #[should_fail] - fn test_overrun_get() { - let cv = malloc(16); - - cv.get(17); - } - - #[test] - #[should_fail] - fn test_overrun_set() { - let mut cv = malloc(16); - - *cv.get_mut(17) = 0; - } - - #[test] - fn test_unwrap() { - unsafe { - let cv = CVec::new_with_dtor(1 as *mut int, 0, - proc() { fail!("Don't run this destructor!") }); - let p = cv.unwrap(); - assert_eq!(p, 1 as *mut int); - } - } - -} diff --git a/src/libextra/lib.rs b/src/libextra/lib.rs deleted file mode 100644 index 4bb6b0050b8..00000000000 --- a/src/libextra/lib.rs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -/*! - -Rust extras. - -The `extra` crate is a set of useful modules for a variety of -purposes, including collections, numerics, I/O, serialization, -and concurrency. - -Rust extras are part of the standard Rust distribution. - -*/ - -#[crate_id = "extra#0.10-pre"]; -#[comment = "Rust extras"]; -#[license = "MIT/ASL2"]; -#[crate_type = "rlib"]; -#[crate_type = "dylib"]; -#[doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", - html_favicon_url = "http://www.rust-lang.org/favicon.ico", - html_root_url = "http://static.rust-lang.org/doc/master")]; - -#[feature(macro_rules, globs, managed_boxes, asm, default_type_params)]; - -#[allow(deprecated_owned_vector)]; -#[deny(non_camel_case_types)]; -#[deny(missing_doc)]; - -extern crate collections; -extern crate rand; -extern crate serialize; -extern crate sync; -extern crate time; - -// Utility modules -pub mod c_vec; -pub mod url; -pub mod tempfile; -pub mod workcache; -pub mod stats; - -#[cfg(unicode)] -mod unicode; diff --git a/src/libextra/unicode.rs b/src/libextra/unicode.rs deleted file mode 100644 index 094a4b02a24..00000000000 --- a/src/libextra/unicode.rs +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[allow(missing_doc)]; - -pub mod icu { - pub type UBool = u8; - pub type UProperty = int; - pub type UChar32 = char; - - pub static TRUE : u8 = 1u8; - pub static FALSE : u8 = 0u8; - - pub static UCHAR_ALPHABETIC : UProperty = 0; - pub static UCHAR_BINARY_START : UProperty = 0; // = UCHAR_ALPHABETIC - pub static UCHAR_ASCII_HEX_DIGIT : UProperty = 1; - pub static UCHAR_BIDI_CONTROL : UProperty = 2; - - pub static UCHAR_BIDI_MIRRORED : UProperty = 3; - pub static UCHAR_DASH : UProperty = 4; - pub static UCHAR_DEFAULT_IGNORABLE_CODE_POINT : UProperty = 5; - pub static UCHAR_DEPRECATED : UProperty = 6; - - pub static UCHAR_DIACRITIC : UProperty = 7; - pub static UCHAR_EXTENDER : UProperty = 8; - pub static UCHAR_FULL_COMPOSITION_EXCLUSION : UProperty = 9; - pub static UCHAR_GRAPHEME_BASE : UProperty = 10; - - pub static UCHAR_GRAPHEME_EXTEND : UProperty = 11; - pub static UCHAR_GRAPHEME_LINK : UProperty = 12; - pub static UCHAR_HEX_DIGIT : UProperty = 13; - pub static UCHAR_HYPHEN : UProperty = 14; - - pub static UCHAR_ID_CONTINUE : UProperty = 15; - pub static UCHAR_ID_START : UProperty = 16; - pub static UCHAR_IDEOGRAPHIC : UProperty = 17; - pub static UCHAR_IDS_BINARY_OPERATOR : UProperty = 18; - - pub static UCHAR_IDS_TRINARY_OPERATOR : UProperty = 19; - pub static UCHAR_JOIN_CONTROL : UProperty = 20; - pub static UCHAR_LOGICAL_ORDER_EXCEPTION : UProperty = 21; - pub static UCHAR_LOWERCASE : UProperty = 22; - - pub static UCHAR_MATH : UProperty = 23; - pub static UCHAR_NONCHARACTER_CODE_POINT : UProperty = 24; - pub static UCHAR_QUOTATION_MARK : UProperty = 25; - pub static UCHAR_RADICAL : UProperty = 26; - - pub static UCHAR_SOFT_DOTTED : UProperty = 27; - pub static UCHAR_TERMINAL_PUNCTUATION : UProperty = 28; - pub static UCHAR_UNIFIED_IDEOGRAPH : UProperty = 29; - pub static UCHAR_UPPERCASE : UProperty = 30; - - pub static UCHAR_WHITE_SPACE : UProperty = 31; - pub static UCHAR_XID_CONTINUE : UProperty = 32; - pub static UCHAR_XID_START : UProperty = 33; - pub static UCHAR_CASE_SENSITIVE : UProperty = 34; - - pub static UCHAR_S_TERM : UProperty = 35; - pub static UCHAR_VARIATION_SELECTOR : UProperty = 36; - pub static UCHAR_NFD_INERT : UProperty = 37; - pub static UCHAR_NFKD_INERT : UProperty = 38; - - pub static UCHAR_NFC_INERT : UProperty = 39; - pub static UCHAR_NFKC_INERT : UProperty = 40; - pub static UCHAR_SEGMENT_STARTER : UProperty = 41; - pub static UCHAR_PATTERN_SYNTAX : UProperty = 42; - - pub static UCHAR_PATTERN_WHITE_SPACE : UProperty = 43; - pub static UCHAR_POSIX_ALNUM : UProperty = 44; - pub static UCHAR_POSIX_BLANK : UProperty = 45; - pub static UCHAR_POSIX_GRAPH : UProperty = 46; - - pub static UCHAR_POSIX_PRINT : UProperty = 47; - pub static UCHAR_POSIX_XDIGIT : UProperty = 48; - pub static UCHAR_CASED : UProperty = 49; - pub static UCHAR_CASE_IGNORABLE : UProperty = 50; - - pub static UCHAR_CHANGES_WHEN_LOWERCASED : UProperty = 51; - pub static UCHAR_CHANGES_WHEN_UPPERCASED : UProperty = 52; - pub static UCHAR_CHANGES_WHEN_TITLECASED : UProperty = 53; - pub static UCHAR_CHANGES_WHEN_CASEFOLDED : UProperty = 54; - - pub static UCHAR_CHANGES_WHEN_CASEMAPPED : UProperty = 55; - pub static UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED : UProperty = 56; - pub static UCHAR_BINARY_LIMIT : UProperty = 57; - pub static UCHAR_BIDI_CLASS : UProperty = 0x1000; - - pub static UCHAR_INT_START : UProperty = 0x1000; // UCHAR_BIDI_CLASS - pub static UCHAR_BLOCK : UProperty = 0x1001; - pub static UCHAR_CANONICAL_COMBINING_CLASS : UProperty = 0x1002; - pub static UCHAR_DECOMPOSITION_TYPE : UProperty = 0x1003; - - pub static UCHAR_EAST_ASIAN_WIDTH : UProperty = 0x1004; - pub static UCHAR_GENERAL_CATEGORY : UProperty = 0x1005; - pub static UCHAR_JOINING_GROUP : UProperty = 0x1006; - pub static UCHAR_JOINING_TYPE : UProperty = 0x1007; - - pub static UCHAR_LINE_BREAK : UProperty = 0x1008; - pub static UCHAR_NUMERIC_TYPE : UProperty = 0x1009; - pub static UCHAR_SCRIPT : UProperty = 0x100A; - pub static UCHAR_HANGUL_SYLLABLE_TYPE : UProperty = 0x100B; - - pub static UCHAR_NFD_QUICK_CHECK : UProperty = 0x100C; - pub static UCHAR_NFKD_QUICK_CHECK : UProperty = 0x100D; - pub static UCHAR_NFC_QUICK_CHECK : UProperty = 0x100E; - pub static UCHAR_NFKC_QUICK_CHECK : UProperty = 0x100F; - - pub static UCHAR_LEAD_CANONICAL_COMBINING_CLASS : UProperty = 0x1010; - pub static UCHAR_TRAIL_CANONICAL_COMBINING_CLASS : UProperty = 0x1011; - pub static UCHAR_GRAPHEME_CLUSTER_BREAK : UProperty = 0x1012; - pub static UCHAR_SENTENCE_BREAK : UProperty = 0x1013; - - pub static UCHAR_WORD_BREAK : UProperty = 0x1014; - pub static UCHAR_INT_LIMIT : UProperty = 0x1015; - - pub static UCHAR_GENERAL_CATEGORY_MASK : UProperty = 0x2000; - pub static UCHAR_MASK_START : UProperty = 0x2000; - // = UCHAR_GENERAL_CATEGORY_MASK - pub static UCHAR_MASK_LIMIT : UProperty = 0x2001; - - pub static UCHAR_NUMERIC_VALUE : UProperty = 0x3000; - pub static UCHAR_DOUBLE_START : UProperty = 0x3000; - // = UCHAR_NUMERIC_VALUE - pub static UCHAR_DOUBLE_LIMIT : UProperty = 0x3001; - - pub static UCHAR_AGE : UProperty = 0x4000; - pub static UCHAR_STRING_START : UProperty = 0x4000; // = UCHAR_AGE - pub static UCHAR_BIDI_MIRRORING_GLYPH : UProperty = 0x4001; - pub static UCHAR_CASE_FOLDING : UProperty = 0x4002; - - pub static UCHAR_ISO_COMMENT : UProperty = 0x4003; - pub static UCHAR_LOWERCASE_MAPPING : UProperty = 0x4004; - pub static UCHAR_NAME : UProperty = 0x4005; - pub static UCHAR_SIMPLE_CASE_FOLDING : UProperty = 0x4006; - - pub static UCHAR_SIMPLE_LOWERCASE_MAPPING : UProperty = 0x4007; - pub static UCHAR_SIMPLE_TITLECASE_MAPPING : UProperty = 0x4008; - pub static UCHAR_SIMPLE_UPPERCASE_MAPPING : UProperty = 0x4009; - pub static UCHAR_TITLECASE_MAPPING : UProperty = 0x400A; - - pub static UCHAR_UNICODE_1_NAME : UProperty = 0x400B; - pub static UCHAR_UPPERCASE_MAPPING : UProperty = 0x400C; - pub static UCHAR_STRING_LIMIT : UProperty = 0x400D; - - pub static UCHAR_SCRIPT_EXTENSIONS : UProperty = 0x7000; - pub static UCHAR_OTHER_PROPERTY_START : UProperty = 0x7000; - // = UCHAR_SCRIPT_EXTENSIONS; - pub static UCHAR_OTHER_PROPERTY_LIMIT : UProperty = 0x7001; - - pub static UCHAR_INVALID_CODE : UProperty = -1; - - pub mod libicu { - use unicode::icu::*; - - // #[link_name = "icuuc"] - #[link(name = "icuuc")] - extern { - pub fn u_hasBinaryProperty(c: UChar32, which: UProperty) -> UBool; - pub fn u_isdigit(c: UChar32) -> UBool; - pub fn u_islower(c: UChar32) -> UBool; - pub fn u_isspace(c: UChar32) -> UBool; - pub fn u_isupper(c: UChar32) -> UBool; - pub fn u_tolower(c: UChar32) -> UChar32; - pub fn u_toupper(c: UChar32) -> UChar32; - } - } -} - -pub fn is_XID_start(c: char) -> bool { - unsafe { - return icu::libicu::u_hasBinaryProperty(c, icu::UCHAR_XID_START) - == icu::TRUE; - } -} - -pub fn is_XID_continue(c: char) -> bool { - unsafe { - return icu::libicu::u_hasBinaryProperty(c, icu::UCHAR_XID_START) - == icu::TRUE; - } -} - -/* -Function: is_digit - -Returns true if a character is a digit. -*/ -pub fn is_digit(c: char) -> bool { - unsafe { - return icu::libicu::u_isdigit(c) == icu::TRUE; - } -} - -/* -Function: is_lower - -Returns true if a character is a lowercase letter. -*/ -pub fn is_lower(c: char) -> bool { - unsafe { - return icu::libicu::u_islower(c) == icu::TRUE; - } -} - -/* -Function: is_space - -Returns true if a character is space. -*/ -pub fn is_space(c: char) -> bool { - unsafe { - return icu::libicu::u_isspace(c) == icu::TRUE; - } -} - -/* -Function: is_upper - -Returns true if a character is an uppercase letter. -*/ -pub fn is_upper(c: char) -> bool { - unsafe { - return icu::libicu::u_isupper(c) == icu::TRUE; - } -} - -#[cfg(test)] -mod tests { - use unicode::*; - - #[test] - fn test_is_digit() { - assert!((is_digit('0'))); - assert!((!is_digit('m'))); - } - - #[test] - fn test_is_lower() { - assert!((is_lower('m'))); - assert!((!is_lower('M'))); - } - - #[test] - fn test_is_space() { - assert!((is_space(' '))); - assert!((!is_space('m'))); - } - - #[test] - fn test_is_upper() { - assert!((is_upper('M'))); - assert!((!is_upper('m'))); - } -} diff --git a/src/libflate/lib.rs b/src/libflate/lib.rs index e0da51a75af..41dc4e3976a 100644 --- a/src/libflate/lib.rs +++ b/src/libflate/lib.rs @@ -18,12 +18,10 @@ #[crate_type = "rlib"]; #[crate_type = "dylib"]; #[license = "MIT/ASL2"]; -#[allow(missing_doc)]; -extern crate extra; use std::libc::{c_void, size_t, c_int}; use std::libc; -use extra::c_vec::CVec; +use std::c_vec::CVec; pub mod rustrt { use std::libc::{c_int, c_void, size_t}; diff --git a/src/librustc/back/archive.rs b/src/librustc/back/archive.rs index d297df1301e..a47b6860014 100644 --- a/src/librustc/back/archive.rs +++ b/src/librustc/back/archive.rs @@ -17,14 +17,13 @@ use std::cast; use std::vec_ng::Vec; -use std::io::fs; use std::io; +use std::io::{fs, TempDir}; use std::libc; use std::os; use std::io::process::{ProcessConfig, Process, ProcessOutput}; use std::str; use std::raw; -use extra::tempfile::TempDir; use syntax::abi; pub static METADATA_FILENAME: &'static str = "rust.metadata.bin"; diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index c15c55927a9..25081017f07 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -32,12 +32,10 @@ use std::ptr; use std::str; use std::io; -use std::io::Process; -use std::io::fs; +use std::io::{fs, TempDir, Process}; use std::vec_ng::Vec; use flate; use serialize::hex::ToHex; -use extra::tempfile::TempDir; use syntax::abi; use syntax::ast; use syntax::ast_map::{PathElem, PathElems, PathName}; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 9fe4a122b4a..e7764802f17 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -32,7 +32,6 @@ #[feature(macro_rules, globs, struct_variant, managed_boxes)]; #[feature(quote, default_type_params)]; -extern crate extra; extern crate flate; extern crate arena; extern crate syntax; diff --git a/src/librustc/metadata/cstore.rs b/src/librustc/metadata/cstore.rs index 1d683ec60da..d502018da17 100644 --- a/src/librustc/metadata/cstore.rs +++ b/src/librustc/metadata/cstore.rs @@ -19,8 +19,8 @@ use std::cell::RefCell; use std::vec_ng::Vec; +use std::c_vec::CVec; use collections::HashMap; -use extra::c_vec::CVec; use syntax::ast; use syntax::parse::token::IdentInterner; use syntax::crateid::CrateId; diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index c4fef224552..3f8703b4f75 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -19,7 +19,6 @@ extern crate syntax; extern crate rustc; -extern crate extra; extern crate serialize; extern crate sync; extern crate getopts; diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 24dc3480544..5b6edeaf79d 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -11,14 +11,13 @@ use std::cell::RefCell; use std::char; use std::io; -use std::io::Process; +use std::io::{Process, TempDir}; use std::local_data; use std::os; use std::str; use collections::HashSet; use testing; -use extra::tempfile::TempDir; use rustc::back::link; use rustc::driver::driver; use rustc::driver::session; @@ -178,9 +177,6 @@ fn maketest(s: &str, cratename: &str, loose_feature_gating: bool) -> ~str { } if !s.contains("extern crate") { - if s.contains("extra") { - prog.push_str("extern crate extra;\n"); - } if s.contains(cratename) { prog.push_str(format!("extern crate {};\n", cratename)); } diff --git a/src/libstd/c_vec.rs b/src/libstd/c_vec.rs new file mode 100644 index 00000000000..00d250a5fc7 --- /dev/null +++ b/src/libstd/c_vec.rs @@ -0,0 +1,216 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//! Library to interface with chunks of memory allocated in C. +//! +//! It is often desirable to safely interface with memory allocated from C, +//! encapsulating the unsafety into allocation and destruction time. Indeed, +//! allocating memory externally is currently the only way to give Rust shared +//! mut state with C programs that keep their own references; vectors are +//! unsuitable because they could be reallocated or moved at any time, and +//! importing C memory into a vector takes a one-time snapshot of the memory. +//! +//! This module simplifies the usage of such external blocks of memory. Memory +//! is encapsulated into an opaque object after creation; the lifecycle of the +//! memory can be optionally managed by Rust, if an appropriate destructor +//! closure is provided. Safety is ensured by bounds-checking accesses, which +//! are marshalled through get and set functions. +//! +//! There are three unsafe functions: the two constructors, and the +//! unwrap method. The constructors are unsafe for the +//! obvious reason (they act on a pointer that cannot be checked inside the +//! method), but `unwrap()` is somewhat more subtle in its unsafety. +//! It returns the contained pointer, but at the same time destroys the CVec +//! without running its destructor. This can be used to pass memory back to +//! C, but care must be taken that the ownership of underlying resources are +//! handled correctly, i.e. that allocated memory is eventually freed +//! if necessary. + +use cast; +use container::Container; +use ptr; +use ptr::RawPtr; +use raw; +use option::{Option, Some, None}; +use ops::Drop; + +/// The type representing a foreign chunk of memory +pub struct CVec { + priv base: *mut T, + priv len: uint, + priv dtor: Option, +} + +#[unsafe_destructor] +impl Drop for CVec { + fn drop(&mut self) { + match self.dtor.take() { + None => (), + Some(f) => f() + } + } +} + +impl CVec { + /// Create a `CVec` from a raw pointer to a buffer with a given length. + /// + /// Fails if the given pointer is null. The returned vector will not attempt + /// to deallocate the vector when dropped. + /// + /// # Arguments + /// + /// * base - A raw pointer to a buffer + /// * len - The number of elements in the buffer + pub unsafe fn new(base: *mut T, len: uint) -> CVec { + assert!(base != ptr::mut_null()); + CVec { + base: base, + len: len, + dtor: None, + } + } + + /// Create a `CVec` from a foreign buffer, with a given length, + /// and a function to run upon destruction. + /// + /// Fails if the given pointer is null. + /// + /// # Arguments + /// + /// * base - A foreign pointer to a buffer + /// * len - The number of elements in the buffer + /// * dtor - A proc to run when the value is destructed, useful + /// for freeing the buffer, etc. + pub unsafe fn new_with_dtor(base: *mut T, len: uint, + dtor: proc()) -> CVec { + assert!(base != ptr::mut_null()); + CVec { + base: base, + len: len, + dtor: Some(dtor), + } + } + + /// View the stored data as a slice. + pub fn as_slice<'a>(&'a self) -> &'a [T] { + unsafe { + cast::transmute(raw::Slice { data: self.base as *T, len: self.len }) + } + } + + /// View the stored data as a mutable slice. + pub fn as_mut_slice<'a>(&'a mut self) -> &'a mut [T] { + unsafe { + cast::transmute(raw::Slice { data: self.base as *T, len: self.len }) + } + } + + /// Retrieves an element at a given index, returning `None` if the requested + /// index is greater than the length of the vector. + pub fn get<'a>(&'a self, ofs: uint) -> Option<&'a T> { + if ofs < self.len { + Some(unsafe { &*self.base.offset(ofs as int) }) + } else { + None + } + } + + /// Retrieves a mutable element at a given index, returning `None` if the + /// requested index is greater than the length of the vector. + pub fn get_mut<'a>(&'a mut self, ofs: uint) -> Option<&'a mut T> { + if ofs < self.len { + Some(unsafe { &mut *self.base.offset(ofs as int) }) + } else { + None + } + } + + /// Unwrap the pointer without running the destructor + /// + /// This method retrieves the underlying pointer, and in the process + /// destroys the CVec but without running the destructor. A use case + /// would be transferring ownership of the buffer to a C function, as + /// in this case you would not want to run the destructor. + /// + /// Note that if you want to access the underlying pointer without + /// cancelling the destructor, you can simply call `transmute` on the return + /// value of `get(0)`. + pub unsafe fn unwrap(mut self) -> *mut T { + self.dtor = None; + self.base + } +} + +impl Container for CVec { + fn len(&self) -> uint { self.len } +} + +#[cfg(test)] +mod tests { + use prelude::*; + + use super::CVec; + use libc; + use ptr; + use rt::global_heap::malloc_raw; + + fn malloc(n: uint) -> CVec { + unsafe { + let mem = malloc_raw(n); + + CVec::new_with_dtor(mem as *mut u8, n, + proc() { libc::free(mem as *mut libc::c_void); }) + } + } + + #[test] + fn test_basic() { + let mut cv = malloc(16); + + *cv.get_mut(3).unwrap() = 8; + *cv.get_mut(4).unwrap() = 9; + assert_eq!(*cv.get(3).unwrap(), 8); + assert_eq!(*cv.get(4).unwrap(), 9); + assert_eq!(cv.len(), 16); + } + + #[test] + #[should_fail] + fn test_fail_at_null() { + unsafe { + CVec::new(ptr::mut_null::(), 9); + } + } + + #[test] + fn test_overrun_get() { + let cv = malloc(16); + + assert!(cv.get(17).is_none()); + } + + #[test] + fn test_overrun_set() { + let mut cv = malloc(16); + + assert!(cv.get_mut(17).is_none()); + } + + #[test] + fn test_unwrap() { + unsafe { + let cv = CVec::new_with_dtor(1 as *mut int, 0, + proc() { fail!("Don't run this destructor!") }); + let p = cv.unwrap(); + assert_eq!(p, 1 as *mut int); + } + } + +} diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 869643336a9..28f6d13070e 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -241,40 +241,31 @@ fn file_product(p: &Path) -> IoResult { pub use self::net::udp::UdpStream; pub use self::pipe::PipeStream; pub use self::process::{Process, ProcessConfig}; +pub use self::tempfile::TempDir; pub use self::mem::{MemReader, BufReader, MemWriter, BufWriter}; pub use self::buffered::{BufferedReader, BufferedWriter, BufferedStream, LineBufferedWriter}; pub use self::comm_adapters::{ChanReader, ChanWriter}; +// this comes first to get the iotest! macro pub mod test; +mod buffered; +mod comm_adapters; +mod mem; +mod result; +mod tempfile; +pub mod extensions; pub mod fs; - +pub mod net; pub mod pipe; - pub mod process; - -pub mod net; - -mod mem; - +pub mod signal; pub mod stdio; - -mod result; - -pub mod extensions; - pub mod timer; - -mod buffered; - -pub mod signal; - pub mod util; -mod comm_adapters; - /// The default buffer size for various I/O operations // libuv recommends 64k buffers to maximize throughput // https://groups.google.com/forum/#!topic/libuv/oQO1HJAIDdA diff --git a/src/libextra/tempfile.rs b/src/libstd/io/tempfile.rs similarity index 80% rename from src/libextra/tempfile.rs rename to src/libstd/io/tempfile.rs index 905541604e0..34d6b19199a 100644 --- a/src/libextra/tempfile.rs +++ b/src/libstd/io/tempfile.rs @@ -10,11 +10,16 @@ //! Temporary files and directories - -use std::os; -use rand::{task_rng, Rng}; -use std::io; -use std::io::fs; +use io::fs; +use io; +use iter::{Iterator, range}; +use libc; +use ops::Drop; +use option::{Option, None, Some}; +use os; +use path::{Path, GenericPath}; +use result::{Ok, Err}; +use sync::atomics; /// A wrapper for a path to temporary directory implementing automatic /// scope-based deletion. @@ -30,13 +35,17 @@ impl TempDir { /// If no directory can be created, None is returned. pub fn new_in(tmpdir: &Path, suffix: &str) -> Option { if !tmpdir.is_absolute() { - let abs_tmpdir = os::make_absolute(tmpdir); - return TempDir::new_in(&abs_tmpdir, suffix); + return TempDir::new_in(&os::make_absolute(tmpdir), suffix); } - let mut r = task_rng(); + static mut CNT: atomics::AtomicUint = atomics::INIT_ATOMIC_UINT; + for _ in range(0u, 1000) { - let p = tmpdir.join(r.gen_ascii_str(16) + suffix); + let filename = format!("rs-{}-{}-{}", + unsafe { libc::getpid() }, + unsafe { CNT.fetch_add(1, atomics::SeqCst) }, + suffix); + let p = tmpdir.join(filename); match fs::mkdir(&p, io::UserRWX) { Err(..) => {} Ok(()) => return Some(TempDir { path: Some(p) }) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 24a77b71fba..6b1773ec7ff 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -74,9 +74,8 @@ #[cfg(test)] extern crate native; #[cfg(test)] extern crate green; -// Make extra and rand accessible for benchmarking/testcases +// Make and rand accessible for benchmarking/testcases #[cfg(test)] extern crate rand; -#[cfg(test)] extern crate extra = "extra"; // Make std testable by not duplicating lang items. See #2912 #[cfg(test)] extern crate realstd = "std"; @@ -172,6 +171,7 @@ #[unstable] pub mod libc; pub mod c_str; +pub mod c_vec; pub mod os; pub mod io; pub mod path; diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 3a86aa3d6b6..b8f00d1b692 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -1392,7 +1392,6 @@ mod tests { use rand::Rng; use rand; - #[test] pub fn last_os_error() { debug!("{}", os::last_os_error()); diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b4f7238c9c7..040c4da6885 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4320,7 +4320,7 @@ fn parse_foreign_mod_items(&mut self, /// /// # Example /// - /// extern crate extra; + /// extern crate url; /// extern crate foo = "bar"; fn parse_item_extern_crate(&mut self, lo: BytePos, diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index a3e68591d50..3ed72e384f7 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -29,19 +29,17 @@ #[crate_type = "rlib"]; #[crate_type = "dylib"]; -#[feature(asm)]; +#[feature(asm, macro_rules)]; #[allow(deprecated_owned_vector)]; extern crate collections; -extern crate extra; extern crate getopts; extern crate serialize; extern crate term; extern crate time; use collections::TreeMap; -use extra::stats::Stats; -use extra::stats; +use stats::Stats; use time::precise_time_ns; use getopts::{OptGroup, optflag, optopt}; use serialize::{json, Decodable}; @@ -68,9 +66,11 @@ pub mod test { MetricChange, Improvement, Regression, LikelyNoise, StaticTestFn, StaticTestName, DynTestName, DynTestFn, run_test, test_main, test_main_static, filter_tests, - parse_opts}; + parse_opts, StaticBenchFn}; } +pub mod stats; + // The name of a test. By convention this follows the rules for rust // paths; i.e. it should be a series of identifiers separated by double // colons. This way if some test runner wants to arrange the tests @@ -1309,7 +1309,7 @@ mod tests { Metric, MetricMap, MetricAdded, MetricRemoved, Improvement, Regression, LikelyNoise, StaticTestName, DynTestName, DynTestFn}; - use extra::tempfile::TempDir; + use std::io::TempDir; #[test] pub fn do_not_run_ignored_tests() { diff --git a/src/libextra/stats.rs b/src/libtest/stats.rs similarity index 99% rename from src/libextra/stats.rs rename to src/libtest/stats.rs index d67e8f85ba9..b3fd06bd6ad 100644 --- a/src/libextra/stats.rs +++ b/src/libtest/stats.rs @@ -1034,19 +1034,18 @@ fn test_sum_f64_between_ints_that_sum_to_0() { #[cfg(test)] mod bench { - extern crate test; - use self::test::BenchHarness; + use BenchHarness; use std::vec; use stats::Stats; #[bench] - fn sum_three_items(bh: &mut BenchHarness) { + pub fn sum_three_items(bh: &mut BenchHarness) { bh.iter(|| { [1e20, 1.5, -1e20].sum(); }) } #[bench] - fn sum_many_f64(bh: &mut BenchHarness) { + pub fn sum_many_f64(bh: &mut BenchHarness) { let nums = [-1e30, 1e60, 1e30, 1.0, -1e60]; let v = vec::from_fn(500, |i| nums[i%5]); diff --git a/src/libextra/url.rs b/src/liburl/lib.rs similarity index 98% rename from src/libextra/url.rs rename to src/liburl/lib.rs index 6be90c0056d..69e1dce7376 100644 --- a/src/libextra/url.rs +++ b/src/liburl/lib.rs @@ -10,7 +10,14 @@ //! Types/fns concerning URLs (see RFC 3986) -#[allow(missing_doc)]; +#[crate_id = "url#0.10-pre"]; +#[crate_type = "rlib"]; +#[crate_type = "dylib"]; +#[license = "MIT/ASL2"]; +#[feature(default_type_params)]; +#[allow(deprecated_owned_vector)]; + +extern crate collections; use std::cmp::Eq; use std::fmt; @@ -28,7 +35,7 @@ /// # Example /// /// ```rust -/// use extra::url::{Url, UserInfo}; +/// use url::{Url, UserInfo}; /// /// let url = Url { scheme: ~"https", /// user: Some(UserInfo { user: ~"username", pass: None }), @@ -174,7 +181,7 @@ fn encode_inner(s: &str, full_url: bool) -> ~str { * # Example * * ```rust - * use extra::url::encode; + * use url::encode; * * let url = encode(&"https://example.com/Rust (programming language)"); * println!("{}", url); // https://example.com/Rust%20(programming%20language) @@ -249,7 +256,7 @@ fn decode_inner(s: &str, full_url: bool) -> ~str { * # Example * * ```rust - * use extra::url::decode; + * use url::decode; * * let url = decode(&"https://example.com/Rust%20(programming%20language)"); * println!("{}", url); // https://example.com/Rust (programming language) @@ -436,8 +443,6 @@ fn query_from_str(rawquery: &str) -> Query { * # Example * * ```rust - * use extra::url; - * * let query = ~[(~"title", ~"The Village"), (~"north", ~"52.91"), (~"west", ~"4.10")]; * println!("{}", url::query_to_str(&query)); // title=The%20Village&north=52.91&west=4.10 * ``` @@ -464,7 +469,7 @@ pub fn query_to_str(query: &Query) -> ~str { * # Example * * ```rust - * use extra::url::get_scheme; + * use url::get_scheme; * * let scheme = match get_scheme("https://example.com/") { * Ok((sch, _)) => sch, @@ -948,8 +953,9 @@ fn test_get_path() { #[cfg(test)] mod tests { - - use super::*; + use {encode_form_urlencoded, decode_form_urlencoded, decode_component, + decode, encode, from_str, encode_component, decode_component, + path_from_str, UserInfo, get_scheme}; use collections::HashMap; diff --git a/src/libextra/workcache.rs b/src/libworkcache/lib.rs similarity index 98% rename from src/libextra/workcache.rs rename to src/libworkcache/lib.rs index 274258daf16..eb63f2dacbb 100644 --- a/src/libextra/workcache.rs +++ b/src/libworkcache/lib.rs @@ -8,8 +8,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[allow(missing_doc)]; -#[allow(visible_private_types)]; +#[crate_id = "workcache#0.10-pre"]; +#[crate_type = "rlib"]; +#[crate_type = "dylib"]; +#[license = "MIT/ASL2"]; +#[allow(deprecated_owned_vector, visible_private_types)]; + +extern crate serialize; +extern crate collections; +extern crate sync; use serialize::json; use serialize::json::ToJson; diff --git a/src/test/auxiliary/issue-2526.rs b/src/test/auxiliary/issue-2526.rs index 701c9f643ff..ef5c141a3d5 100644 --- a/src/test/auxiliary/issue-2526.rs +++ b/src/test/auxiliary/issue-2526.rs @@ -11,8 +11,6 @@ #[crate_id="issue_2526#0.2"]; #[crate_type = "lib"]; -extern crate extra; - struct arc_destruct { _data: int, } diff --git a/src/test/auxiliary/issue-2631-a.rs b/src/test/auxiliary/issue-2631-a.rs index 1a287b5e625..448d545ee22 100644 --- a/src/test/auxiliary/issue-2631-a.rs +++ b/src/test/auxiliary/issue-2631-a.rs @@ -12,7 +12,6 @@ #[crate_id="req"]; #[crate_type = "lib"]; -extern crate extra; extern crate collections; use std::cell::RefCell; diff --git a/src/test/bench/rt-messaging-ping-pong.rs b/src/test/bench/rt-messaging-ping-pong.rs index 1e00915e3f5..044c4b07d44 100644 --- a/src/test/bench/rt-messaging-ping-pong.rs +++ b/src/test/bench/rt-messaging-ping-pong.rs @@ -17,8 +17,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::os; use std::uint; diff --git a/src/test/bench/rt-parfib.rs b/src/test/bench/rt-parfib.rs index b636554cffb..1a7302207d9 100644 --- a/src/test/bench/rt-parfib.rs +++ b/src/test/bench/rt-parfib.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::os; use std::uint; diff --git a/src/test/bench/rt-spawn-rate.rs b/src/test/bench/rt-spawn-rate.rs index 40e6a0a7bed..5f445de069c 100644 --- a/src/test/bench/rt-spawn-rate.rs +++ b/src/test/bench/rt-spawn-rate.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::task::spawn; use std::os; use std::uint; diff --git a/src/test/bench/shootout-ackermann.rs b/src/test/bench/shootout-ackermann.rs index d308ed6a7d1..889d663fb5b 100644 --- a/src/test/bench/shootout-ackermann.rs +++ b/src/test/bench/shootout-ackermann.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::os; fn ack(m: int, n: int) -> int { diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index 0dead2ca376..51aff969996 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -10,8 +10,6 @@ // chameneos -extern crate extra; - use std::option; use std::os; use std::task; diff --git a/src/test/bench/shootout-fibo.rs b/src/test/bench/shootout-fibo.rs index 4a4b2e8e875..785481819aa 100644 --- a/src/test/bench/shootout-fibo.rs +++ b/src/test/bench/shootout-fibo.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::os; fn fib(n: int) -> int { diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index 767559664a4..2ddcd2b5bfd 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -13,7 +13,6 @@ // ignore-pretty the `let to_child` line gets an extra newline // multi tasking k-nucleotide -extern crate extra; extern crate collections; use std::cmp::Ord; diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index d2ce61ee755..e69ede619de 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -12,8 +12,6 @@ #[feature(managed_boxes)]; -extern crate extra; - use std::io; use std::io::stdio::StdReader; use std::io::BufferedReader; diff --git a/src/test/compile-fail/deriving-span-Clone-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-Clone-enum-struct-variant.rs index 6f3ce6abe1a..37560444af6 100644 --- a/src/test/compile-fail/deriving-span-Clone-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-Clone-enum-struct-variant.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Clone-enum.rs b/src/test/compile-fail/deriving-span-Clone-enum.rs index c138c259a0f..89acf95f156 100644 --- a/src/test/compile-fail/deriving-span-Clone-enum.rs +++ b/src/test/compile-fail/deriving-span-Clone-enum.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Clone-struct.rs b/src/test/compile-fail/deriving-span-Clone-struct.rs index 9226c4a7960..0afcfa18c73 100644 --- a/src/test/compile-fail/deriving-span-Clone-struct.rs +++ b/src/test/compile-fail/deriving-span-Clone-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Clone-tuple-struct.rs b/src/test/compile-fail/deriving-span-Clone-tuple-struct.rs index e49bd45f4d0..d116a791620 100644 --- a/src/test/compile-fail/deriving-span-Clone-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Clone-tuple-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Default-struct.rs b/src/test/compile-fail/deriving-span-Default-struct.rs index 5da4ae5ca42..09afd9730fb 100644 --- a/src/test/compile-fail/deriving-span-Default-struct.rs +++ b/src/test/compile-fail/deriving-span-Default-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Default-tuple-struct.rs b/src/test/compile-fail/deriving-span-Default-tuple-struct.rs index 3f44ea926b5..4dbcc3de1fa 100644 --- a/src/test/compile-fail/deriving-span-Default-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Default-tuple-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Eq-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-Eq-enum-struct-variant.rs index 482954b39f7..4e9dfd96c63 100644 --- a/src/test/compile-fail/deriving-span-Eq-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-Eq-enum-struct-variant.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Eq-enum.rs b/src/test/compile-fail/deriving-span-Eq-enum.rs index 5221869a285..794c36b43d8 100644 --- a/src/test/compile-fail/deriving-span-Eq-enum.rs +++ b/src/test/compile-fail/deriving-span-Eq-enum.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Eq-struct.rs b/src/test/compile-fail/deriving-span-Eq-struct.rs index a063628993e..4488e74d851 100644 --- a/src/test/compile-fail/deriving-span-Eq-struct.rs +++ b/src/test/compile-fail/deriving-span-Eq-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Eq-tuple-struct.rs b/src/test/compile-fail/deriving-span-Eq-tuple-struct.rs index efa92c0a29a..949e1cee37a 100644 --- a/src/test/compile-fail/deriving-span-Eq-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Eq-tuple-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Hash-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-Hash-enum-struct-variant.rs index b08f7305cfc..1323c4daf94 100644 --- a/src/test/compile-fail/deriving-span-Hash-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-Hash-enum-struct-variant.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Hash-enum.rs b/src/test/compile-fail/deriving-span-Hash-enum.rs index 6fe0094c8d2..af78a1ace70 100644 --- a/src/test/compile-fail/deriving-span-Hash-enum.rs +++ b/src/test/compile-fail/deriving-span-Hash-enum.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Hash-struct.rs b/src/test/compile-fail/deriving-span-Hash-struct.rs index 0ae28d084ec..c8fdb0f19a5 100644 --- a/src/test/compile-fail/deriving-span-Hash-struct.rs +++ b/src/test/compile-fail/deriving-span-Hash-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Hash-tuple-struct.rs b/src/test/compile-fail/deriving-span-Hash-tuple-struct.rs index 1b69abb3e16..897483c8ada 100644 --- a/src/test/compile-fail/deriving-span-Hash-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Hash-tuple-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Ord-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-Ord-enum-struct-variant.rs index edfc949970f..a99191fd0dc 100644 --- a/src/test/compile-fail/deriving-span-Ord-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-Ord-enum-struct-variant.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; #[deriving(Eq)] diff --git a/src/test/compile-fail/deriving-span-Ord-enum.rs b/src/test/compile-fail/deriving-span-Ord-enum.rs index 13da4454c3e..2be3d5c83af 100644 --- a/src/test/compile-fail/deriving-span-Ord-enum.rs +++ b/src/test/compile-fail/deriving-span-Ord-enum.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; #[deriving(Eq)] diff --git a/src/test/compile-fail/deriving-span-Ord-struct.rs b/src/test/compile-fail/deriving-span-Ord-struct.rs index bab38983dfb..5848bda1750 100644 --- a/src/test/compile-fail/deriving-span-Ord-struct.rs +++ b/src/test/compile-fail/deriving-span-Ord-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; #[deriving(Eq)] diff --git a/src/test/compile-fail/deriving-span-Ord-tuple-struct.rs b/src/test/compile-fail/deriving-span-Ord-tuple-struct.rs index bb211d7781e..198721e9b75 100644 --- a/src/test/compile-fail/deriving-span-Ord-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Ord-tuple-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; #[deriving(Eq)] diff --git a/src/test/compile-fail/deriving-span-Rand-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-Rand-enum-struct-variant.rs index 9338e23fbb4..4fee8aa84e6 100644 --- a/src/test/compile-fail/deriving-span-Rand-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-Rand-enum-struct-variant.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Rand-enum.rs b/src/test/compile-fail/deriving-span-Rand-enum.rs index 1a978176d79..58f8a2b44b2 100644 --- a/src/test/compile-fail/deriving-span-Rand-enum.rs +++ b/src/test/compile-fail/deriving-span-Rand-enum.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Rand-struct.rs b/src/test/compile-fail/deriving-span-Rand-struct.rs index 7f628503980..7350f94e76b 100644 --- a/src/test/compile-fail/deriving-span-Rand-struct.rs +++ b/src/test/compile-fail/deriving-span-Rand-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Rand-tuple-struct.rs b/src/test/compile-fail/deriving-span-Rand-tuple-struct.rs index 9b11c027846..0d7631e8e20 100644 --- a/src/test/compile-fail/deriving-span-Rand-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Rand-tuple-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Show-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-Show-enum-struct-variant.rs index 972f60bf2c9..b3f94ff606d 100644 --- a/src/test/compile-fail/deriving-span-Show-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-Show-enum-struct-variant.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Show-enum.rs b/src/test/compile-fail/deriving-span-Show-enum.rs index ba3fd1766b2..f3ff502c6e2 100644 --- a/src/test/compile-fail/deriving-span-Show-enum.rs +++ b/src/test/compile-fail/deriving-span-Show-enum.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Show-struct.rs b/src/test/compile-fail/deriving-span-Show-struct.rs index 1e38c9dda5b..258efaaba0c 100644 --- a/src/test/compile-fail/deriving-span-Show-struct.rs +++ b/src/test/compile-fail/deriving-span-Show-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Show-tuple-struct.rs b/src/test/compile-fail/deriving-span-Show-tuple-struct.rs index 7347b324a23..002495389f3 100644 --- a/src/test/compile-fail/deriving-span-Show-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Show-tuple-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-TotalEq-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-TotalEq-enum-struct-variant.rs index 4d362678283..5d6d4531b40 100644 --- a/src/test/compile-fail/deriving-span-TotalEq-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-TotalEq-enum-struct-variant.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; #[deriving(Eq)] diff --git a/src/test/compile-fail/deriving-span-TotalEq-enum.rs b/src/test/compile-fail/deriving-span-TotalEq-enum.rs index 66f84612f81..b80aa2646d2 100644 --- a/src/test/compile-fail/deriving-span-TotalEq-enum.rs +++ b/src/test/compile-fail/deriving-span-TotalEq-enum.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; #[deriving(Eq)] diff --git a/src/test/compile-fail/deriving-span-TotalEq-struct.rs b/src/test/compile-fail/deriving-span-TotalEq-struct.rs index ba29180e5e6..878316c4b03 100644 --- a/src/test/compile-fail/deriving-span-TotalEq-struct.rs +++ b/src/test/compile-fail/deriving-span-TotalEq-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; #[deriving(Eq)] diff --git a/src/test/compile-fail/deriving-span-TotalEq-tuple-struct.rs b/src/test/compile-fail/deriving-span-TotalEq-tuple-struct.rs index 6dbd1e3cee9..c590a1f2164 100644 --- a/src/test/compile-fail/deriving-span-TotalEq-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-TotalEq-tuple-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; #[deriving(Eq)] diff --git a/src/test/compile-fail/deriving-span-TotalOrd-enum-struct-variant.rs b/src/test/compile-fail/deriving-span-TotalOrd-enum-struct-variant.rs index 54f7667be30..d6ca5f72675 100644 --- a/src/test/compile-fail/deriving-span-TotalOrd-enum-struct-variant.rs +++ b/src/test/compile-fail/deriving-span-TotalOrd-enum-struct-variant.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; #[deriving(Eq, Ord, TotalEq)] diff --git a/src/test/compile-fail/deriving-span-TotalOrd-enum.rs b/src/test/compile-fail/deriving-span-TotalOrd-enum.rs index 6f51522d1a6..e53c8495914 100644 --- a/src/test/compile-fail/deriving-span-TotalOrd-enum.rs +++ b/src/test/compile-fail/deriving-span-TotalOrd-enum.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; #[deriving(Eq, Ord, TotalEq)] diff --git a/src/test/compile-fail/deriving-span-TotalOrd-struct.rs b/src/test/compile-fail/deriving-span-TotalOrd-struct.rs index b659e4cee22..8b7a9d3bea6 100644 --- a/src/test/compile-fail/deriving-span-TotalOrd-struct.rs +++ b/src/test/compile-fail/deriving-span-TotalOrd-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; #[deriving(Eq, Ord, TotalEq)] diff --git a/src/test/compile-fail/deriving-span-TotalOrd-tuple-struct.rs b/src/test/compile-fail/deriving-span-TotalOrd-tuple-struct.rs index d4f30946d8e..ff139237217 100644 --- a/src/test/compile-fail/deriving-span-TotalOrd-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-TotalOrd-tuple-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; #[deriving(Eq, Ord, TotalEq)] diff --git a/src/test/compile-fail/deriving-span-Zero-struct.rs b/src/test/compile-fail/deriving-span-Zero-struct.rs index 2e00c92f469..acebdff28ff 100644 --- a/src/test/compile-fail/deriving-span-Zero-struct.rs +++ b/src/test/compile-fail/deriving-span-Zero-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/deriving-span-Zero-tuple-struct.rs b/src/test/compile-fail/deriving-span-Zero-tuple-struct.rs index 9487c6ced62..64600fef2c5 100644 --- a/src/test/compile-fail/deriving-span-Zero-tuple-struct.rs +++ b/src/test/compile-fail/deriving-span-Zero-tuple-struct.rs @@ -11,7 +11,6 @@ // This file was auto-generated using 'src/etc/generate-keyword-span-tests.py' #[feature(struct_variant)]; -extern crate extra; extern crate rand; diff --git a/src/test/compile-fail/issue-3021-b.rs b/src/test/compile-fail/issue-3021-b.rs index 038b2b0d876..daef77f6314 100644 --- a/src/test/compile-fail/issue-3021-b.rs +++ b/src/test/compile-fail/issue-3021-b.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - fn siphash(k0 : u64) { struct siphash { diff --git a/src/test/compile-fail/issue-3021-c.rs b/src/test/compile-fail/issue-3021-c.rs index 392cc2f3c90..1fb71f01d06 100644 --- a/src/test/compile-fail/issue-3021-c.rs +++ b/src/test/compile-fail/issue-3021-c.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - fn siphash() { trait t { diff --git a/src/test/compile-fail/issue-3021-d.rs b/src/test/compile-fail/issue-3021-d.rs index 95c0eb711e8..ddb33f1e61a 100644 --- a/src/test/compile-fail/issue-3021-d.rs +++ b/src/test/compile-fail/issue-3021-d.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - trait siphash { fn result(&self) -> u64; fn reset(&self); diff --git a/src/test/compile-fail/issue-3021.rs b/src/test/compile-fail/issue-3021.rs index 7bb1faf514a..d44d81b7fe0 100644 --- a/src/test/compile-fail/issue-3021.rs +++ b/src/test/compile-fail/issue-3021.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - trait SipHash { fn reset(&self); } diff --git a/src/test/compile-fail/moves-based-on-type-cyclic-types-issue-4821.rs b/src/test/compile-fail/moves-based-on-type-cyclic-types-issue-4821.rs index 97a2b00ba42..cf82cf087a3 100644 --- a/src/test/compile-fail/moves-based-on-type-cyclic-types-issue-4821.rs +++ b/src/test/compile-fail/moves-based-on-type-cyclic-types-issue-4821.rs @@ -12,8 +12,6 @@ // temporary kinds wound up being stored in a cache and used later. // See middle::ty::type_contents() for more information. -extern crate extra; - struct List { key: int, next: Option<~List> } fn foo(node: ~List) -> int { diff --git a/src/test/compile-fail/pattern-tyvar-2.rs b/src/test/compile-fail/pattern-tyvar-2.rs index e58c4b14685..3e4b2502fd0 100644 --- a/src/test/compile-fail/pattern-tyvar-2.rs +++ b/src/test/compile-fail/pattern-tyvar-2.rs @@ -9,8 +9,6 @@ // except according to those terms. -extern crate extra; - enum bar { t1((), Option<~[int]>), t2, } // n.b. my change changes this error message, but I think it's right -- tjc diff --git a/src/test/compile-fail/pattern-tyvar.rs b/src/test/compile-fail/pattern-tyvar.rs index b687a225754..94614e4970a 100644 --- a/src/test/compile-fail/pattern-tyvar.rs +++ b/src/test/compile-fail/pattern-tyvar.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - // error-pattern: mismatched types enum bar { t1((), Option<~[int]>), t2, } diff --git a/src/test/compile-fail/qquote-1.rs b/src/test/compile-fail/qquote-1.rs index d45759e38d9..09cac75baa0 100644 --- a/src/test/compile-fail/qquote-1.rs +++ b/src/test/compile-fail/qquote-1.rs @@ -12,7 +12,6 @@ #[feature(quote)]; -extern crate extra; extern crate syntax; use io::*; diff --git a/src/test/compile-fail/qquote-2.rs b/src/test/compile-fail/qquote-2.rs index b5c2dee61c7..82d0cb2e198 100644 --- a/src/test/compile-fail/qquote-2.rs +++ b/src/test/compile-fail/qquote-2.rs @@ -12,11 +12,8 @@ #[feature(quote)]; -extern crate extra; extern crate syntax; -use extra::io::*; - use syntax::diagnostic; use syntax::ast; use syntax::codemap; diff --git a/src/test/compile-fail/regions-glb-free-free.rs b/src/test/compile-fail/regions-glb-free-free.rs index 8453ace2b51..8531a1a71c7 100644 --- a/src/test/compile-fail/regions-glb-free-free.rs +++ b/src/test/compile-fail/regions-glb-free-free.rs @@ -9,8 +9,6 @@ // except according to those terms. mod argparse { - extern crate extra; - pub struct Flag<'a> { name: &'a str, desc: &'a str, diff --git a/src/test/compile-fail/seq-args.rs b/src/test/compile-fail/seq-args.rs index f543d442a23..35c18c49547 100644 --- a/src/test/compile-fail/seq-args.rs +++ b/src/test/compile-fail/seq-args.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; fn main() { trait seq { } diff --git a/src/test/compile-fail/spawn-non-nil-fn.rs b/src/test/compile-fail/spawn-non-nil-fn.rs index e82c49d977f..3a35d9cc309 100644 --- a/src/test/compile-fail/spawn-non-nil-fn.rs +++ b/src/test/compile-fail/spawn-non-nil-fn.rs @@ -10,8 +10,6 @@ // error-pattern: mismatched types -extern crate extra; - use std::task; fn main() { task::spawn(|| -> int { 10 }); } diff --git a/src/test/compile-fail/unresolved-extern-mod-suggestion.rs b/src/test/compile-fail/unresolved-extern-mod-suggestion.rs index a39ffa64dfd..c5b061caf6e 100644 --- a/src/test/compile-fail/unresolved-extern-mod-suggestion.rs +++ b/src/test/compile-fail/unresolved-extern-mod-suggestion.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; -use extra; //~ ERROR unresolved import (maybe you meant `extra::*`?) +extern crate collections; +use collections; //~ ERROR unresolved import (maybe you meant `collections::*`?) fn main() {} diff --git a/src/test/compile-fail/view-items-at-top.rs b/src/test/compile-fail/view-items-at-top.rs index d4b25b6baeb..7b78a8d932b 100644 --- a/src/test/compile-fail/view-items-at-top.rs +++ b/src/test/compile-fail/view-items-at-top.rs @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; +extern crate test; fn f() { } -use extra::net; //~ ERROR `use` and `extern crate` declarations must precede items +use test::net; //~ ERROR `use` and `extern crate` declarations must precede items fn main() { } diff --git a/src/test/run-fail/fail-main.rs b/src/test/run-fail/fail-main.rs index d51a2728d3a..f90530a4435 100644 --- a/src/test/run-fail/fail-main.rs +++ b/src/test/run-fail/fail-main.rs @@ -9,5 +9,4 @@ // except according to those terms. // error-pattern:moop -extern crate extra; fn main() { fail!("moop"); } diff --git a/src/test/run-fail/fmt-fail.rs b/src/test/run-fail/fmt-fail.rs index ada9e698e65..e54c754f53b 100644 --- a/src/test/run-fail/fmt-fail.rs +++ b/src/test/run-fail/fmt-fail.rs @@ -9,6 +9,5 @@ // except according to those terms. // error-pattern:meh -extern crate extra; fn main() { let str_var: ~str = ~"meh"; fail!("{}", str_var); } diff --git a/src/test/run-fail/for-each-loop-fail.rs b/src/test/run-fail/for-each-loop-fail.rs index f3e8c9d298c..508463599a3 100644 --- a/src/test/run-fail/for-each-loop-fail.rs +++ b/src/test/run-fail/for-each-loop-fail.rs @@ -9,6 +9,5 @@ // except according to those terms. // error-pattern:moop -extern crate extra; fn main() { for _ in range(0u, 10u) { fail!("moop"); } } diff --git a/src/test/run-fail/morestack2.rs b/src/test/run-fail/morestack2.rs index 08ab065598d..2430c5bb666 100644 --- a/src/test/run-fail/morestack2.rs +++ b/src/test/run-fail/morestack2.rs @@ -16,8 +16,6 @@ // See the hack in upcall_call_shim_on_c_stack where it messes // with the stack limit. -extern crate extra; - use std::libc; use std::task; diff --git a/src/test/run-fail/morestack3.rs b/src/test/run-fail/morestack3.rs index b15be740231..2e4aafb9b0d 100644 --- a/src/test/run-fail/morestack3.rs +++ b/src/test/run-fail/morestack3.rs @@ -13,8 +13,6 @@ // Just testing unwinding -extern crate extra; - use std::task; fn getbig_and_fail(i: int) { diff --git a/src/test/run-fail/morestack4.rs b/src/test/run-fail/morestack4.rs index 7cd19410bfc..6d326779ca2 100644 --- a/src/test/run-fail/morestack4.rs +++ b/src/test/run-fail/morestack4.rs @@ -13,8 +13,6 @@ // Just testing unwinding -extern crate extra; - use std::task; fn getbig_and_fail(i: int) { diff --git a/src/test/run-fail/run-unexported-tests.rs b/src/test/run-fail/run-unexported-tests.rs index c25eef44683..b8941275591 100644 --- a/src/test/run-fail/run-unexported-tests.rs +++ b/src/test/run-fail/run-unexported-tests.rs @@ -12,8 +12,6 @@ // compile-flags:--test // check-stdout -extern crate extra; - mod m { pub fn exported() { } diff --git a/src/test/run-pass-fulldeps/qquote.rs b/src/test/run-pass-fulldeps/qquote.rs index 0e31cbd2e95..9a37af1e125 100644 --- a/src/test/run-pass-fulldeps/qquote.rs +++ b/src/test/run-pass-fulldeps/qquote.rs @@ -13,7 +13,6 @@ #[feature(quote)]; -extern crate extra; extern crate syntax; use std::io::*; diff --git a/src/test/run-pass/attr-before-view-item.rs b/src/test/run-pass/attr-before-view-item.rs index 30d4315f081..2a65fd9d8a6 100644 --- a/src/test/run-pass/attr-before-view-item.rs +++ b/src/test/run-pass/attr-before-view-item.rs @@ -11,7 +11,7 @@ // error-pattern:expected item #[foo = "bar"] -extern crate extra; +extern crate test; pub fn main() { } diff --git a/src/test/run-pass/attr-before-view-item2.rs b/src/test/run-pass/attr-before-view-item2.rs index 0d099841c0b..5b8e62de6bd 100644 --- a/src/test/run-pass/attr-before-view-item2.rs +++ b/src/test/run-pass/attr-before-view-item2.rs @@ -12,7 +12,7 @@ mod m { #[foo = "bar"] - extern crate extra; + extern crate test; } pub fn main() { diff --git a/src/test/run-pass/block-arg-call-as.rs b/src/test/run-pass/block-arg-call-as.rs index c149afb8782..fd40f0b4b80 100644 --- a/src/test/run-pass/block-arg-call-as.rs +++ b/src/test/run-pass/block-arg-call-as.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - fn asSendfn(f: proc() -> uint) -> uint { return f(); } diff --git a/src/test/run-pass/clone-with-exterior.rs b/src/test/run-pass/clone-with-exterior.rs index 091cebcc063..6db42c1e2ee 100644 --- a/src/test/run-pass/clone-with-exterior.rs +++ b/src/test/run-pass/clone-with-exterior.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; use std::task::spawn; struct Pair { diff --git a/src/test/run-pass/explicit-self-generic.rs b/src/test/run-pass/explicit-self-generic.rs index a3c5256c2d3..30b716f75d8 100644 --- a/src/test/run-pass/explicit-self-generic.rs +++ b/src/test/run-pass/explicit-self-generic.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - /** * A function that returns a hash of a value * diff --git a/src/test/run-pass/extern-foreign-crate.rs b/src/test/run-pass/extern-foreign-crate.rs index 1c5df4acf73..434b684756b 100644 --- a/src/test/run-pass/extern-foreign-crate.rs +++ b/src/test/run-pass/extern-foreign-crate.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; extern crate mystd = "std"; pub fn main() {} diff --git a/src/test/run-pass/float-nan.rs b/src/test/run-pass/float-nan.rs index 66c84d52745..4d9f7d507f0 100644 --- a/src/test/run-pass/float-nan.rs +++ b/src/test/run-pass/float-nan.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::num::Float; pub fn main() { diff --git a/src/test/run-pass/foreign-fn-linkname.rs b/src/test/run-pass/foreign-fn-linkname.rs index 7e480f1c32b..7e6a362cabe 100644 --- a/src/test/run-pass/foreign-fn-linkname.rs +++ b/src/test/run-pass/foreign-fn-linkname.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - mod libc { use std::libc::{c_char, size_t}; diff --git a/src/test/run-pass/glob-std.rs b/src/test/run-pass/glob-std.rs index 39261094911..03c83bb24c8 100644 --- a/src/test/run-pass/glob-std.rs +++ b/src/test/run-pass/glob-std.rs @@ -13,14 +13,13 @@ #[feature(macro_rules)]; -extern crate extra; extern crate glob; use glob::glob; -use extra::tempfile::TempDir; use std::unstable::finally::Finally; use std::{os, unstable}; use std::io; +use std::io::TempDir; macro_rules! assert_eq ( ($e1:expr, $e2:expr) => ( if $e1 != $e2 { diff --git a/src/test/run-pass/import-glob-crate.rs b/src/test/run-pass/import-glob-crate.rs index f2117efb0bb..3ba8f5eace5 100644 --- a/src/test/run-pass/import-glob-crate.rs +++ b/src/test/run-pass/import-glob-crate.rs @@ -13,7 +13,6 @@ #[feature(globs)]; #[allow(dead_assignment)]; -extern crate extra; use std::vec::*; pub fn main() { diff --git a/src/test/run-pass/infinite-loops.rs b/src/test/run-pass/infinite-loops.rs index 50091c94a76..f4de938c66e 100644 --- a/src/test/run-pass/infinite-loops.rs +++ b/src/test/run-pass/infinite-loops.rs @@ -14,8 +14,6 @@ */ // ignore-test -extern crate extra; - fn loopy(n: int) { if n > 0 { spawn(proc() { loopy(n - 1) }); spawn(proc() { loopy(n - 1) }); } loop { } diff --git a/src/test/run-pass/intrinsics-integer.rs b/src/test/run-pass/intrinsics-integer.rs index 9c62f5052b2..88c964462e8 100644 --- a/src/test/run-pass/intrinsics-integer.rs +++ b/src/test/run-pass/intrinsics-integer.rs @@ -12,8 +12,6 @@ #[feature(globs)]; -extern crate extra; - mod rusti { extern "rust-intrinsic" { pub fn ctpop8(x: i8) -> i8; diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index 45f59fe9cd4..463ed02a716 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -14,8 +14,6 @@ /// Map representation -extern crate extra; - use std::io; use std::fmt; diff --git a/src/test/run-pass/issue-2989.rs b/src/test/run-pass/issue-2989.rs index 94e7297f179..b603759380e 100644 --- a/src/test/run-pass/issue-2989.rs +++ b/src/test/run-pass/issue-2989.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::vec; trait methods { diff --git a/src/test/run-pass/issue-3424.rs b/src/test/run-pass/issue-3424.rs index 374607326df..7cd995f18f4 100644 --- a/src/test/run-pass/issue-3424.rs +++ b/src/test/run-pass/issue-3424.rs @@ -11,7 +11,6 @@ // except according to those terms. // rustc --test ignores2.rs && ./ignores2 -extern crate extra; use std::path::{Path}; use std::path; diff --git a/src/test/run-pass/issue-3556.rs b/src/test/run-pass/issue-3556.rs index e7089a6a21e..5a787f8c0ee 100644 --- a/src/test/run-pass/issue-3556.rs +++ b/src/test/run-pass/issue-3556.rs @@ -10,8 +10,6 @@ #[feature(managed_boxes)]; -extern crate extra; - enum Token { Text(@~str), ETag(@~[~str], @~str), diff --git a/src/test/run-pass/issue-3563-3.rs b/src/test/run-pass/issue-3563-3.rs index ae65c46ce71..7d051e378ab 100644 --- a/src/test/run-pass/issue-3563-3.rs +++ b/src/test/run-pass/issue-3563-3.rs @@ -16,7 +16,6 @@ // However the extra library is designed to be optional (for code that must run on constrained // environments like embedded devices or special environments like kernel code) so it must // be explicitly linked in. -extern crate extra; // Extern mod controls linkage. Use controls the visibility of names to modules that are // already linked in. Using WriterUtil allows us to use the write_line method. diff --git a/src/test/run-pass/issue-3574.rs b/src/test/run-pass/issue-3574.rs index b216ca9a1ca..b3b610b91a7 100644 --- a/src/test/run-pass/issue-3574.rs +++ b/src/test/run-pass/issue-3574.rs @@ -11,7 +11,6 @@ #[allow(unnecessary_allocation)]; // rustc --test match_borrowed_str.rs.rs && ./match_borrowed_str.rs -extern crate extra; fn compare(x: &str, y: &str) -> bool { diff --git a/src/test/run-pass/issue-3609.rs b/src/test/run-pass/issue-3609.rs index 611af3cb36d..d50a1b6a0be 100644 --- a/src/test/run-pass/issue-3609.rs +++ b/src/test/run-pass/issue-3609.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::task; type RingBuffer = ~[f64]; diff --git a/src/test/run-pass/item-attributes.rs b/src/test/run-pass/item-attributes.rs index 8ea06e51080..22356764410 100644 --- a/src/test/run-pass/item-attributes.rs +++ b/src/test/run-pass/item-attributes.rs @@ -16,7 +16,7 @@ #[attr3]; #[attr4(attr5)]; -#[crate_id="extra#0.1"]; +#[crate_id="foobar#0.1"]; // These are attributes of the following mod #[attr1 = "val"] @@ -140,8 +140,6 @@ fn f() { } } mod test_distinguish_syntax_ext { - extern crate extra; - pub fn f() { format!("test{}", "s"); #[attr = "val"] diff --git a/src/test/run-pass/match-join.rs b/src/test/run-pass/match-join.rs index 90768fdc6c9..d6654db854f 100644 --- a/src/test/run-pass/match-join.rs +++ b/src/test/run-pass/match-join.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -extern crate extra; - fn foo(y: Option) { let mut x: int; let mut rs: ~[int] = ~[]; diff --git a/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs b/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs index 3bedd340fea..60cd2941bec 100644 --- a/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs +++ b/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs @@ -10,8 +10,6 @@ #[feature(managed_boxes)]; -extern crate extra; - trait Serializer { } diff --git a/src/test/run-pass/morestack5.rs b/src/test/run-pass/morestack5.rs index ba1128978d3..65dabba191b 100644 --- a/src/test/run-pass/morestack5.rs +++ b/src/test/run-pass/morestack5.rs @@ -12,8 +12,6 @@ // This test will call __morestack with various minimum stack sizes -extern crate extra; - use std::task; fn getbig(i: int) { diff --git a/src/test/run-pass/move-3-unique.rs b/src/test/run-pass/move-3-unique.rs index 2bd1eb7fd4b..867f00aff53 100644 --- a/src/test/run-pass/move-3-unique.rs +++ b/src/test/run-pass/move-3-unique.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - #[deriving(Clone)] struct Triple { x: int, diff --git a/src/test/run-pass/move-3.rs b/src/test/run-pass/move-3.rs index 2819d9bd76e..b065b612be5 100644 --- a/src/test/run-pass/move-3.rs +++ b/src/test/run-pass/move-3.rs @@ -10,8 +10,6 @@ #[feature(managed_boxes)]; -extern crate extra; - struct Triple { x: int, y: int, z: int } fn test(x: bool, foo: @Triple) -> int { diff --git a/src/test/run-pass/move-4-unique.rs b/src/test/run-pass/move-4-unique.rs index 660fb447bb0..60537d99d84 100644 --- a/src/test/run-pass/move-4-unique.rs +++ b/src/test/run-pass/move-4-unique.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - struct Triple {a: int, b: int, c: int} fn test(foo: ~Triple) -> ~Triple { diff --git a/src/test/run-pass/move-4.rs b/src/test/run-pass/move-4.rs index 67b071af0a2..a7ff1bfb23e 100644 --- a/src/test/run-pass/move-4.rs +++ b/src/test/run-pass/move-4.rs @@ -10,8 +10,6 @@ #[feature(managed_boxes)]; -extern crate extra; - struct Triple { a: int, b: int, c: int } fn test(foo: @Triple) -> @Triple { diff --git a/src/test/run-pass/mutable-alias-vec.rs b/src/test/run-pass/mutable-alias-vec.rs index f512a465985..34ce5c66539 100644 --- a/src/test/run-pass/mutable-alias-vec.rs +++ b/src/test/run-pass/mutable-alias-vec.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - fn grow(v: &mut ~[int]) { v.push(1); } diff --git a/src/test/run-pass/preempt.rs b/src/test/run-pass/preempt.rs index 64dfd3fdefc..df1d22f2c86 100644 --- a/src/test/run-pass/preempt.rs +++ b/src/test/run-pass/preempt.rs @@ -12,10 +12,7 @@ // This checks that preemption works. // note: halfway done porting to modern rust -extern crate extra; - use std::comm; -use extra::comm; fn starve_main(alive: Receiver) { info!("signalling main"); diff --git a/src/test/run-pass/regions-lifetime-static-items-enclosing-scopes.rs b/src/test/run-pass/regions-lifetime-static-items-enclosing-scopes.rs index 975dcab1902..9e0ca203698 100644 --- a/src/test/run-pass/regions-lifetime-static-items-enclosing-scopes.rs +++ b/src/test/run-pass/regions-lifetime-static-items-enclosing-scopes.rs @@ -11,7 +11,6 @@ // This test verifies that temporary lifetime is correctly computed // for static objects in enclosing scopes. -extern crate extra; use std::cmp::Eq; fn f(o: &mut Option) { diff --git a/src/test/run-pass/rename-directory.rs b/src/test/run-pass/rename-directory.rs index 3f14d7befac..ef43dad2c68 100644 --- a/src/test/run-pass/rename-directory.rs +++ b/src/test/run-pass/rename-directory.rs @@ -12,9 +12,8 @@ // because it needs TempDir, which is in extra // ignore-fast -extern crate extra; -use extra::tempfile::TempDir; +use std::io::TempDir; use std::os; use std::libc; use std::io; diff --git a/src/test/run-pass/spawn.rs b/src/test/run-pass/spawn.rs index 00273669378..987aa9ee7e3 100644 --- a/src/test/run-pass/spawn.rs +++ b/src/test/run-pass/spawn.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::task; pub fn main() { diff --git a/src/test/run-pass/stat.rs b/src/test/run-pass/stat.rs index 33f4c9d9a98..96e76c798ff 100644 --- a/src/test/run-pass/stat.rs +++ b/src/test/run-pass/stat.rs @@ -10,13 +10,10 @@ // ignore-fast -extern crate extra; - -use extra::tempfile; -use std::io::File; +use std::io::{File, TempDir}; pub fn main() { - let dir = tempfile::TempDir::new_in(&Path::new("."), "").unwrap(); + let dir = TempDir::new_in(&Path::new("."), "").unwrap(); let path = dir.path().join("file"); { diff --git a/src/test/run-pass/str-append.rs b/src/test/run-pass/str-append.rs index c6ff57ac4e8..90d5bae56f4 100644 --- a/src/test/run-pass/str-append.rs +++ b/src/test/run-pass/str-append.rs @@ -8,10 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - -extern crate extra; - fn test1() { let mut s: ~str = ~"hello"; s.push_str("world"); diff --git a/src/test/run-pass/str-multiline.rs b/src/test/run-pass/str-multiline.rs index 3c5a860d6c8..2331ca64dee 100644 --- a/src/test/run-pass/str-multiline.rs +++ b/src/test/run-pass/str-multiline.rs @@ -8,10 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - - -extern crate extra; - pub fn main() { let a: ~str = ~"this \ is a test"; diff --git a/src/test/run-pass/string-self-append.rs b/src/test/run-pass/string-self-append.rs index 34a818879d0..10230065b91 100644 --- a/src/test/run-pass/string-self-append.rs +++ b/src/test/run-pass/string-self-append.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - pub fn main() { // Make sure we properly handle repeated self-appends. let mut a: ~str = ~"A"; diff --git a/src/test/run-pass/task-comm-0.rs b/src/test/run-pass/task-comm-0.rs index 9e5c6ba8e97..cbab11003b1 100644 --- a/src/test/run-pass/task-comm-0.rs +++ b/src/test/run-pass/task-comm-0.rs @@ -10,8 +10,6 @@ // ignore-fast -extern crate extra; - use std::task; pub fn main() { test05(); } diff --git a/src/test/run-pass/task-comm-10.rs b/src/test/run-pass/task-comm-10.rs index 5ea21422cd0..844e39e584e 100644 --- a/src/test/run-pass/task-comm-10.rs +++ b/src/test/run-pass/task-comm-10.rs @@ -10,8 +10,6 @@ // ignore-fast -extern crate extra; - use std::task; fn start(tx: &Sender>) { diff --git a/src/test/run-pass/task-comm-11.rs b/src/test/run-pass/task-comm-11.rs index d39d688a478..254988c8b0e 100644 --- a/src/test/run-pass/task-comm-11.rs +++ b/src/test/run-pass/task-comm-11.rs @@ -10,8 +10,6 @@ // ignore-fast -extern crate extra; - use std::task; fn start(tx: &Sender>) { diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs index 8092fb6d4ad..d0c5efbfa22 100644 --- a/src/test/run-pass/task-comm-12.rs +++ b/src/test/run-pass/task-comm-12.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::task; pub fn main() { test00(); } diff --git a/src/test/run-pass/task-comm-13.rs b/src/test/run-pass/task-comm-13.rs index bad03e8792e..0b1e9580a1e 100644 --- a/src/test/run-pass/task-comm-13.rs +++ b/src/test/run-pass/task-comm-13.rs @@ -10,8 +10,6 @@ // ignore-fast -extern crate extra; - use std::task; fn start(tx: &Sender, start: int, number_of_messages: int) { diff --git a/src/test/run-pass/task-comm-15.rs b/src/test/run-pass/task-comm-15.rs index 6855a32ceb0..355f179ad17 100644 --- a/src/test/run-pass/task-comm-15.rs +++ b/src/test/run-pass/task-comm-15.rs @@ -10,8 +10,6 @@ // ignore-fast -extern crate extra; - use std::task; fn start(tx: &Sender, i0: int) { diff --git a/src/test/run-pass/task-comm-17.rs b/src/test/run-pass/task-comm-17.rs index 70a59c5b85d..4f4d365901e 100644 --- a/src/test/run-pass/task-comm-17.rs +++ b/src/test/run-pass/task-comm-17.rs @@ -12,8 +12,6 @@ // This test is specifically about spawning temporary closures. -extern crate extra; - use std::task; fn f() { diff --git a/src/test/run-pass/task-comm-3.rs b/src/test/run-pass/task-comm-3.rs index c27e199b377..0ed76593b9e 100644 --- a/src/test/run-pass/task-comm-3.rs +++ b/src/test/run-pass/task-comm-3.rs @@ -10,8 +10,6 @@ // ignore-fast -extern crate extra; - use std::task; pub fn main() { info!("===== WITHOUT THREADS ====="); test00(); } diff --git a/src/test/run-pass/task-comm-5.rs b/src/test/run-pass/task-comm-5.rs index 64970bcd3fe..e51e14f7fbe 100644 --- a/src/test/run-pass/task-comm-5.rs +++ b/src/test/run-pass/task-comm-5.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - pub fn main() { test00(); } fn test00() { diff --git a/src/test/run-pass/task-comm-7.rs b/src/test/run-pass/task-comm-7.rs index f61547ff688..5d918a4c88f 100644 --- a/src/test/run-pass/task-comm-7.rs +++ b/src/test/run-pass/task-comm-7.rs @@ -12,8 +12,6 @@ #[allow(dead_assignment)]; -extern crate extra; - use std::task; pub fn main() { test00(); } diff --git a/src/test/run-pass/task-comm-9.rs b/src/test/run-pass/task-comm-9.rs index f4fee47fa74..f2493e5d102 100644 --- a/src/test/run-pass/task-comm-9.rs +++ b/src/test/run-pass/task-comm-9.rs @@ -10,8 +10,6 @@ // ignore-fast -extern crate extra; - use std::task; pub fn main() { test00(); } diff --git a/src/test/run-pass/task-comm-chan-nil.rs b/src/test/run-pass/task-comm-chan-nil.rs index 713105df602..3ea17898ead 100644 --- a/src/test/run-pass/task-comm-chan-nil.rs +++ b/src/test/run-pass/task-comm-chan-nil.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -extern crate extra; - // rustboot can't transmit nils across channels because they don't have // any size, but rustc currently can because they do have size. Whether // or not this is desirable I don't know, but here's a regression test. diff --git a/src/test/run-pass/task-life-0.rs b/src/test/run-pass/task-life-0.rs index 54aac31c7de..dfcebbaaee0 100644 --- a/src/test/run-pass/task-life-0.rs +++ b/src/test/run-pass/task-life-0.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::task; pub fn main() { diff --git a/src/test/run-pass/tempfile.rs b/src/test/run-pass/tempfile.rs index 2f3bbbd744d..2bb839aa2cf 100644 --- a/src/test/run-pass/tempfile.rs +++ b/src/test/run-pass/tempfile.rs @@ -19,10 +19,7 @@ // they're in a different location than before. Hence, these tests are all run // serially here. -extern crate extra; - -use extra::tempfile::TempDir; -use std::io::fs; +use std::io::{fs, TempDir}; use std::io; use std::os; use std::task; diff --git a/src/test/run-pass/terminate-in-initializer.rs b/src/test/run-pass/terminate-in-initializer.rs index b63573f6103..9f648b9a473 100644 --- a/src/test/run-pass/terminate-in-initializer.rs +++ b/src/test/run-pass/terminate-in-initializer.rs @@ -13,8 +13,6 @@ // Issue #787 // Don't try to clean up uninitialized locals -extern crate extra; - use std::task; fn test_break() { loop { let _x: @int = break; } } diff --git a/src/test/run-pass/test-ignore-cfg.rs b/src/test/run-pass/test-ignore-cfg.rs index eee667fdb04..ba131569bc4 100644 --- a/src/test/run-pass/test-ignore-cfg.rs +++ b/src/test/run-pass/test-ignore-cfg.rs @@ -11,8 +11,6 @@ // compile-flags: --test --cfg ignorecfg // ignore-fast -extern crate extra; - #[test] #[ignore(cfg(ignorecfg))] fn shouldignore() { diff --git a/src/test/run-pass/test-runner-hides-main.rs b/src/test/run-pass/test-runner-hides-main.rs index cdef159b399..3781a60fcfe 100644 --- a/src/test/run-pass/test-runner-hides-main.rs +++ b/src/test/run-pass/test-runner-hides-main.rs @@ -12,8 +12,6 @@ // ignore-fast // ignore-win32 #10872 -extern crate extra; - // Building as a test runner means that a synthetic main will be run, // not ours pub fn main() { fail!(); } diff --git a/src/test/run-pass/threads.rs b/src/test/run-pass/threads.rs index 3e1d5b3684d..b00689db26b 100644 --- a/src/test/run-pass/threads.rs +++ b/src/test/run-pass/threads.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::task; pub fn main() { diff --git a/src/test/run-pass/trait-inheritance-num.rs b/src/test/run-pass/trait-inheritance-num.rs index b7d5f9c6fd6..3c3198379be 100644 --- a/src/test/run-pass/trait-inheritance-num.rs +++ b/src/test/run-pass/trait-inheritance-num.rs @@ -10,8 +10,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::cmp::{Eq, Ord}; use std::num::NumCast; diff --git a/src/test/run-pass/trait-inheritance-num2.rs b/src/test/run-pass/trait-inheritance-num2.rs index 5e6dc7c67c8..2bfe11d23a3 100644 --- a/src/test/run-pass/trait-inheritance-num2.rs +++ b/src/test/run-pass/trait-inheritance-num2.rs @@ -12,8 +12,6 @@ // A more complex example of numeric extensions -extern crate extra; - use std::cmp::{Eq, Ord}; pub trait TypeExt {} diff --git a/src/test/run-pass/unify-return-ty.rs b/src/test/run-pass/unify-return-ty.rs index fc0d4ce4b89..953140fcfef 100644 --- a/src/test/run-pass/unify-return-ty.rs +++ b/src/test/run-pass/unify-return-ty.rs @@ -11,7 +11,6 @@ // Tests that the tail expr in null() has its type // unified with the type *T, and so the type variable // in that type gets resolved. -extern crate extra; use std::cast; diff --git a/src/test/run-pass/unwind-box.rs b/src/test/run-pass/unwind-box.rs index beaf76cafbc..53e92fc4abb 100644 --- a/src/test/run-pass/unwind-box.rs +++ b/src/test/run-pass/unwind-box.rs @@ -10,8 +10,6 @@ #[feature(managed_boxes)]; -extern crate extra; - use std::task; fn f() { diff --git a/src/test/run-pass/unwind-resource.rs b/src/test/run-pass/unwind-resource.rs index 30bbca89905..fc37e1c39ed 100644 --- a/src/test/run-pass/unwind-resource.rs +++ b/src/test/run-pass/unwind-resource.rs @@ -10,8 +10,6 @@ // ignore-fast -extern crate extra; - use std::task; struct complainer { diff --git a/src/test/run-pass/unwind-resource2.rs b/src/test/run-pass/unwind-resource2.rs index 176eb02105f..3331ee21814 100644 --- a/src/test/run-pass/unwind-resource2.rs +++ b/src/test/run-pass/unwind-resource2.rs @@ -10,8 +10,6 @@ #[feature(managed_boxes)]; -extern crate extra; - use std::task; struct complainer { diff --git a/src/test/run-pass/unwind-unique.rs b/src/test/run-pass/unwind-unique.rs index dabe8c3450b..8bc95b233f1 100644 --- a/src/test/run-pass/unwind-unique.rs +++ b/src/test/run-pass/unwind-unique.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::task; fn f() { diff --git a/src/test/run-pass/use-crate-name-alias.rs b/src/test/run-pass/use-crate-name-alias.rs index 9c53dde21dd..bf9c5838de8 100644 --- a/src/test/run-pass/use-crate-name-alias.rs +++ b/src/test/run-pass/use-crate-name-alias.rs @@ -9,6 +9,6 @@ // except according to those terms. // Issue #1706 -extern crate stdlib = "extra"; +extern crate stdlib = "std"; pub fn main() {} diff --git a/src/test/run-pass/utf8_chars.rs b/src/test/run-pass/utf8_chars.rs index 34ee0933d2a..0e85c67edb7 100644 --- a/src/test/run-pass/utf8_chars.rs +++ b/src/test/run-pass/utf8_chars.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - use std::str; pub fn main() { diff --git a/src/test/run-pass/vec-self-append.rs b/src/test/run-pass/vec-self-append.rs index e9fcfaaf283..f190fd2cb93 100644 --- a/src/test/run-pass/vec-self-append.rs +++ b/src/test/run-pass/vec-self-append.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern crate extra; - fn test_heap_to_heap() { // a spills onto the heap let mut a = ~[0, 1, 2, 3, 4]; -- GitLab