about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2015-04-28 16:02:13 -0700
committerTamir Duberstein <tamird@gmail.com>2015-04-29 08:55:30 -0700
commit9504d8cdae1a22de7ea58ce81738cff88e2b3868 (patch)
tree59ee2e5d8050da9c4dc36156aadbe10bab0e8d5c /src
parent0c0d1387390fb6d30e74387b90663e658cf16b7e (diff)
downloadrust-9504d8cdae1a22de7ea58ce81738cff88e2b3868.tar.gz
rust-9504d8cdae1a22de7ea58ce81738cff88e2b3868.zip
`bitflags!` uses associated constants
Diffstat (limited to 'src')
-rw-r--r--src/librustc_bitflags/lib.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc_bitflags/lib.rs b/src/librustc_bitflags/lib.rs
index 93a2a5d1257..07525cfddbf 100644
--- a/src/librustc_bitflags/lib.rs
+++ b/src/librustc_bitflags/lib.rs
@@ -12,6 +12,7 @@
 // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
 #![cfg_attr(stage0, feature(custom_attribute))]
 #![crate_name = "rustc_bitflags"]
+#![feature(associated_consts)]
 #![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
@@ -34,6 +35,7 @@
 ///
 /// ```{.rust}
 /// # #![feature(rustc_private)]
+/// # #![feature(associated_consts)]
 /// #[macro_use] extern crate rustc_bitflags;
 ///
 /// bitflags! {
@@ -144,9 +146,9 @@ macro_rules! bitflags {
             bits: $T,
         }
 
-        $($(#[$Flag_attr])* pub const $Flag: $BitFlags = $BitFlags { bits: $value };)+
-
         impl $BitFlags {
+            $($(#[$Flag_attr])* pub const $Flag: $BitFlags = $BitFlags { bits: $value };)+
+
             /// Returns an empty set of flags.
             #[inline]
             pub fn empty() -> $BitFlags {