1
Fork 0

Use $crate and macro reexport to reduce duplicated code

Many of libstd's macros are now re-exported from libcore and libcollections.
Their libstd definitions have moved to a macros_stage0 module and can disappear
after the next snapshot.

Where the two crates had already diverged, I took the libstd versions as
they're generally newer and better-tested. See e.g. d3c831b, which was a fix to
libstd's assert_eq!() that didn't make it into libcore's.

Fixes #16806.
This commit is contained in:
Keegan McAllister 2014-09-15 19:29:47 -07:00
parent 1c2fddc6bf
commit 73806ddd0f
13 changed files with 915 additions and 246 deletions

View file

@ -117,13 +117,18 @@
#![reexport_test_harness_main = "test_main"]
#![macro_reexport(assert, assert_eq, debug_assert, debug_assert_eq,
unreachable, unimplemented, write, writeln, vec)]
#[cfg(test)] #[phase(plugin, link)] extern crate log;
extern crate alloc;
extern crate unicode;
#[phase(plugin, link)]
extern crate core;
#[phase(plugin, link)]
extern crate "collections" as core_collections;
extern crate "rand" as core_rand;
extern crate alloc;
extern crate unicode;
extern crate libc;
// Make std testable by not duplicating lang items. See #2912
@ -167,7 +172,8 @@ pub use unicode::char;
/* Exported macros */
pub mod macros;
#[cfg(stage0)] pub mod macros_stage0;
#[cfg(not(stage0))] pub mod macros;
pub mod bitflags;
mod rtdeps;