From 1703827da26ed5cc412f9008ef9c6ab4f89b36b1 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 15 May 2016 12:27:43 +0200 Subject: [PATCH 1/2] Update to bitflags 0.7.0 --- Cargo.toml | 5 +---- src/memory/paging/entry.rs | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 06e657c3..d0cb6f3c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,10 +7,7 @@ version = "0.1.0" once = "0.2.1" rlibc = "0.1.4" spin = "0.3.4" - -[dependencies.bitflags] -features = ["no_std"] -version = "0.4.0" +bitflags = "0.7.0" [dependencies.hole_list_allocator] path = "libs/hole_list_allocator" diff --git a/src/memory/paging/entry.rs b/src/memory/paging/entry.rs index c01c447d..1128bd4d 100644 --- a/src/memory/paging/entry.rs +++ b/src/memory/paging/entry.rs @@ -40,7 +40,7 @@ impl Entry { } bitflags! { - flags EntryFlags: u64 { + pub flags EntryFlags: u64 { const PRESENT = 1 << 0, const WRITABLE = 1 << 1, const USER_ACCESSIBLE = 1 << 2, From e383a9235a9af7aeb916e2443bf13245b694c9d8 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 15 May 2016 12:29:29 +0200 Subject: [PATCH 2/2] Update post to use bitflags 0.7.0 --- blog/post/2015-12-09-modifying-page-tables.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/blog/post/2015-12-09-modifying-page-tables.md b/blog/post/2015-12-09-modifying-page-tables.md index 1d3d903e..c1490d88 100644 --- a/blog/post/2015-12-09-modifying-page-tables.md +++ b/blog/post/2015-12-09-modifying-page-tables.md @@ -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 ```toml -[dependencies.bitflags] -version = "0.4.0" -features = ["no_std"] +[dependencies] +... +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: @@ -113,7 +111,7 @@ Now we can model the various flags: ```rust bitflags! { - flags EntryFlags: u64 { + pub flags EntryFlags: u64 { const PRESENT = 1 << 0, const WRITABLE = 1 << 1, const USER_ACCESSIBLE = 1 << 2,