Skip to content

Commit 464e375

Browse files
committed
Move bitflags module to libstd
This will allow us to provide type-safe APIs in libstd that are C-compatible.
1 parent 43320e5 commit 464e375

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/libcollections/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ pub use smallintmap::SmallIntMap;
4242
pub use treemap::{TreeMap, TreeSet};
4343
pub use trie::{TrieMap, TrieSet};
4444

45-
pub mod bitflags;
4645
pub mod bitv;
4746
pub mod btree;
4847
pub mod deque;

src/libcollections/bitflags.rs renamed to src/libstd/bitflags.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
//! # Example
1818
//!
1919
//! ~~~rust
20-
//! #[feature(phase)];
21-
//! #[phase(syntax)] extern crate collections;
22-
//!
2320
//! bitflags!(Flags: u32 {
2421
//! FlagA = 0x00000001,
2522
//! FlagB = 0x00000010,
@@ -41,9 +38,6 @@
4138
//! The generated `struct`s can also be extended with type and trait implementations:
4239
//!
4340
//! ~~~rust
44-
//! #[feature(phase)];
45-
//! #[phase(syntax)] extern crate collections;
46-
//!
4741
//! use std::fmt;
4842
//!
4943
//! bitflags!(Flags: u32 {
@@ -174,6 +168,8 @@ macro_rules! bitflags(
174168

175169
#[cfg(test)]
176170
mod tests {
171+
use ops::{BitOr, BitAnd, Sub};
172+
177173
bitflags!(Flags: u32 {
178174
FlagA = 0x00000001,
179175
FlagB = 0x00000010,

src/libstd/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ fn start(argc: int, argv: **u8) -> int {
142142
green::start(argc, argv, rustuv::event_loop, __test::main)
143143
}
144144

145+
/* Exported macros */
146+
145147
pub mod macros;
148+
pub mod bitflags;
146149

147150
mod rtdeps;
148151

0 commit comments

Comments
 (0)