Skip to content

Commit 9504d8c

Browse files
committed
bitflags! uses associated constants
1 parent 0c0d138 commit 9504d8c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/librustc_bitflags/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
1313
#![cfg_attr(stage0, feature(custom_attribute))]
1414
#![crate_name = "rustc_bitflags"]
15+
#![feature(associated_consts)]
1516
#![feature(staged_api)]
1617
#![staged_api]
1718
#![crate_type = "rlib"]
@@ -34,6 +35,7 @@
3435
///
3536
/// ```{.rust}
3637
/// # #![feature(rustc_private)]
38+
/// # #![feature(associated_consts)]
3739
/// #[macro_use] extern crate rustc_bitflags;
3840
///
3941
/// bitflags! {
@@ -144,9 +146,9 @@ macro_rules! bitflags {
144146
bits: $T,
145147
}
146148

147-
$($(#[$Flag_attr])* pub const $Flag: $BitFlags = $BitFlags { bits: $value };)+
148-
149149
impl $BitFlags {
150+
$($(#[$Flag_attr])* pub const $Flag: $BitFlags = $BitFlags { bits: $value };)+
151+
150152
/// Returns an empty set of flags.
151153
#[inline]
152154
pub fn empty() -> $BitFlags {

0 commit comments

Comments
 (0)