Merge pull request #90 from topecongiro/hide-impl-macro

Hide impl implementation detail from bitflags! documentation
This commit is contained in:
Alex Crichton 2017-03-24 09:57:58 -05:00 committed by GitHub
commit fc7a9fe685

View File

@ -192,8 +192,8 @@ macro_rules! bitflags {
$($(#[$Flag_attr])* pub const $Flag: $BitFlags = $BitFlags { bits: $value };)+
bitflags! {
@_impl struct $BitFlags: $T {
__impl_bitflags! {
struct $BitFlags: $T {
$($(#[$Flag_attr])* const $Flag = $value;)+
}
}
@ -209,14 +209,19 @@ macro_rules! bitflags {
$($(#[$Flag_attr])* const $Flag: $BitFlags = $BitFlags { bits: $value };)+
bitflags! {
@_impl struct $BitFlags: $T {
__impl_bitflags! {
struct $BitFlags: $T {
$($(#[$Flag_attr])* const $Flag = $value;)+
}
}
};
(@_impl struct $BitFlags:ident: $T:ty {
}
#[macro_export]
#[doc(hidden)]
macro_rules! __impl_bitflags {
(struct $BitFlags:ident: $T:ty {
$($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr;)+
}) => {
impl $crate::__core::fmt::Debug for $BitFlags {