Merge pull request #159 from phil-opp/update_bitflags

Update bitflags to 0.7.0
This commit is contained in:
Philipp Oppermann
2016-05-15 12:32:22 +02:00
3 changed files with 6 additions and 11 deletions

View File

@@ -7,10 +7,7 @@ version = "0.1.0"
once = "0.2.1" once = "0.2.1"
rlibc = "0.1.4" rlibc = "0.1.4"
spin = "0.3.4" spin = "0.3.4"
bitflags = "0.7.0"
[dependencies.bitflags]
features = ["no_std"]
version = "0.4.0"
[dependencies.hole_list_allocator] [dependencies.hole_list_allocator]
path = "libs/hole_list_allocator" path = "libs/hole_list_allocator"

View File

@@ -94,12 +94,10 @@ To model the various flags, we will use the [bitflags] crate. To add it as a dep
[bitflags]: https://github.com/rust-lang-nursery/bitflags [bitflags]: https://github.com/rust-lang-nursery/bitflags
```toml ```toml
[dependencies.bitflags] [dependencies]
version = "0.4.0" ...
features = ["no_std"] bitflags = "0.7.0"
``` ```
The `no_std` feature is needed because `bitflags` depends on the standard library by default. But it has a [cargo feature] to use the core library instead. It will become the default as soon as `no_std` is stable in a stable Rust release.
[cargo feature]: http://doc.crates.io/manifest.html#the-[features]-section
To import the macro, we need to use `#[macro_use]` above the `extern crate` definition: To import the macro, we need to use `#[macro_use]` above the `extern crate` definition:
@@ -113,7 +111,7 @@ Now we can model the various flags:
```rust ```rust
bitflags! { bitflags! {
flags EntryFlags: u64 { pub flags EntryFlags: u64 {
const PRESENT = 1 << 0, const PRESENT = 1 << 0,
const WRITABLE = 1 << 1, const WRITABLE = 1 << 1,
const USER_ACCESSIBLE = 1 << 2, const USER_ACCESSIBLE = 1 << 2,

View File

@@ -40,7 +40,7 @@ impl Entry {
} }
bitflags! { bitflags! {
flags EntryFlags: u64 { pub flags EntryFlags: u64 {
const PRESENT = 1 << 0, const PRESENT = 1 << 0,
const WRITABLE = 1 << 1, const WRITABLE = 1 << 1,
const USER_ACCESSIBLE = 1 << 2, const USER_ACCESSIBLE = 1 << 2,