Skip to content

Commit

Permalink
Move bitflags module to libstd
Browse files Browse the repository at this point in the history
This will allow us to provide type-safe APIs in libstd that are C-compatible.
  • Loading branch information
brendanzab committed Apr 30, 2014
1 parent 43320e5 commit 464e375
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/libcollections/lib.rs
Expand Up @@ -42,7 +42,6 @@ pub use smallintmap::SmallIntMap;
pub use treemap::{TreeMap, TreeSet};
pub use trie::{TrieMap, TrieSet};

pub mod bitflags;
pub mod bitv;
pub mod btree;
pub mod deque;
Expand Down
8 changes: 2 additions & 6 deletions src/libcollections/bitflags.rs → src/libstd/bitflags.rs
Expand Up @@ -17,9 +17,6 @@
//! # Example
//!
//! ~~~rust
//! #[feature(phase)];
//! #[phase(syntax)] extern crate collections;
//!
//! bitflags!(Flags: u32 {
//! FlagA = 0x00000001,
//! FlagB = 0x00000010,
Expand All @@ -41,9 +38,6 @@
//! The generated `struct`s can also be extended with type and trait implementations:
//!
//! ~~~rust
//! #[feature(phase)];
//! #[phase(syntax)] extern crate collections;
//!
//! use std::fmt;
//!
//! bitflags!(Flags: u32 {
Expand Down Expand Up @@ -174,6 +168,8 @@ macro_rules! bitflags(

#[cfg(test)]
mod tests {
use ops::{BitOr, BitAnd, Sub};

bitflags!(Flags: u32 {
FlagA = 0x00000001,
FlagB = 0x00000010,
Expand Down
3 changes: 3 additions & 0 deletions src/libstd/lib.rs
Expand Up @@ -142,7 +142,10 @@ fn start(argc: int, argv: **u8) -> int {
green::start(argc, argv, rustuv::event_loop, __test::main)
}

/* Exported macros */

pub mod macros;
pub mod bitflags;

mod rtdeps;

Expand Down

0 comments on commit 464e375

Please sign in to comment.