Skip to content

Commit 340f042

Browse files
author
Jorge Aparicio
committed
libstd: convert BitFlags unops to by value
1 parent 5359879 commit 340f042

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/libstd/bitflags.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,24 @@ macro_rules! bitflags {
281281
}
282282
}
283283

284+
// NOTE(stage0): Remove impl after a snapshot
285+
#[cfg(stage0)]
284286
impl Not<$BitFlags> for $BitFlags {
285287
/// Returns the complement of this set of flags.
286288
#[inline]
287289
fn not(&self) -> $BitFlags {
288290
$BitFlags { bits: !self.bits } & $BitFlags::all()
289291
}
290292
}
293+
294+
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
295+
impl Not<$BitFlags> for $BitFlags {
296+
/// Returns the complement of this set of flags.
297+
#[inline]
298+
fn not(self) -> $BitFlags {
299+
$BitFlags { bits: !self.bits } & $BitFlags::all()
300+
}
301+
}
291302
};
292303
($(#[$attr:meta])* flags $BitFlags:ident: $T:ty {
293304
$($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr),+,

0 commit comments

Comments
 (0)