Skip to content

Instantly share code, notes, and snippets.

@tamird
Created April 27, 2015 20:43
Show Gist options
  • Save tamird/d4882cd2597a14364a19 to your computer and use it in GitHub Desktop.
Save tamird/d4882cd2597a14364a19 to your computer and use it in GitHub Desktop.
diff --git a/src/librustc_bitflags/lib.rs b/src/librustc_bitflags/lib.rs
index 93a2a5d..629ec97 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"]
@@ -144,9 +145,13 @@ macro_rules! bitflags {
bits: $T,
}
+ #[cfg(stage0)]
$($(#[$Flag_attr])* pub const $Flag: $BitFlags = $BitFlags { bits: $value };)+
impl $BitFlags {
+ #[cfg(not(stage0))]
+ $($(#[$Flag_attr])* pub const $Flag: $BitFlags = $BitFlags { bits: $value };)+
+
/// Returns an empty set of flags.
#[inline]
pub fn empty() -> $BitFlags {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment