summary refs log tree commit diff
path: root/src/libstd/lib.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-16 12:20:03 -0800
committerSteve Klabnik <steve@steveklabnik.com>2015-01-17 10:51:07 -0500
commit34fa70fba5425cbbb96bce783e9fd5c23dd9b471 (patch)
tree6ce5ed5ec0ec21efdfc061c6382dcd2403f6f6d0 /src/libstd/lib.rs
parent02968389dcbc32c757ff5d8a3e7bf96c5d9d4225 (diff)
downloadrust-34fa70fba5425cbbb96bce783e9fd5c23dd9b471.tar.gz
rust-34fa70fba5425cbbb96bce783e9fd5c23dd9b471.zip
std: Move the bitflags! macro to a gated crate
In accordance with [collections reform part 2][rfc] this macro has been moved to
an external [bitflags crate][crate] which is [available though
crates.io][cratesio]. Inside the standard distribution the macro has been moved
to a crate called `rustc_bitflags` for current users to continue using.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0509-collections-reform-part-2.md
[crate]: https://github.com/rust-lang/bitflags
[cratesio]: http://crates.io/crates/bitflags

The major user of `bitflags!` in terms of a public-facing possibly-stable API
today is the `FilePermissions` structure inside of `std::io`. This user,
however, will likely no longer use `bitflags!` after I/O reform has landed. To
prevent breaking APIs today, this structure remains as-is.

Current users of the `bitflags!` macro should add this to their `Cargo.toml`:

    bitflags = "0.1"

and this to their crate root:

    #[macro_use] extern crate bitflags;

Due to the removal of a public macro, this is a:

[breaking-change]
Diffstat (limited to 'src/libstd/lib.rs')
-rw-r--r--src/libstd/lib.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 182344452a4..2553bbdf523 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -111,7 +111,7 @@
 #![feature(box_syntax)]
 #![feature(old_impl_check)]
 #![feature(optin_builtin_traits)]
-#![allow(unknown_features)] #![feature(int_uint)]
+#![feature(int_uint)]
 
 // Don't link to std. We are std.
 #![no_std]
@@ -136,6 +136,8 @@ extern crate alloc;
 extern crate unicode;
 extern crate libc;
 
+#[macro_use] #[no_link] extern crate rustc_bitflags;
+
 // Make std testable by not duplicating lang items. See #2912
 #[cfg(test)] extern crate "std" as realstd;
 #[cfg(test)] pub use realstd::marker;
@@ -181,9 +183,6 @@ pub use unicode::char;
 #[macro_use]
 mod macros;
 
-#[macro_use]
-pub mod bitflags;
-
 mod rtdeps;
 
 /* The Prelude. */