Skip to content

Commit

Permalink
Delete local_inner_macros from exported macros
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 16, 2024
1 parent 89ae29d commit 6511637
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
18 changes: 9 additions & 9 deletions src/external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Next, re-export the library from the `__private` module here.
Next, define a macro like so:
```rust
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
#[cfg(feature = "serde")]
macro_rules! __impl_external_bitflags_my_library {
Expand All @@ -30,7 +30,7 @@ macro_rules! __impl_external_bitflags_my_library {
};
}
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
#[cfg(not(feature = "my_library"))]
macro_rules! __impl_external_bitflags_my_library {
Expand Down Expand Up @@ -77,7 +77,7 @@ pub(crate) mod __private {
}

/// Implements traits from external libraries for the internal bitflags type.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
macro_rules! __impl_external_bitflags {
(
Expand Down Expand Up @@ -125,7 +125,7 @@ macro_rules! __impl_external_bitflags {
pub mod serde;

/// Implement `Serialize` and `Deserialize` for the internal bitflags type.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
#[cfg(feature = "serde")]
macro_rules! __impl_external_bitflags_serde {
Expand Down Expand Up @@ -161,7 +161,7 @@ macro_rules! __impl_external_bitflags_serde {
};
}

#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
#[cfg(not(feature = "serde"))]
macro_rules! __impl_external_bitflags_serde {
Expand All @@ -182,7 +182,7 @@ pub mod arbitrary;
mod bytemuck;

/// Implement `Arbitrary` for the internal bitflags type.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
#[cfg(feature = "arbitrary")]
macro_rules! __impl_external_bitflags_arbitrary {
Expand All @@ -204,7 +204,7 @@ macro_rules! __impl_external_bitflags_arbitrary {
};
}

#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
#[cfg(not(feature = "arbitrary"))]
macro_rules! __impl_external_bitflags_arbitrary {
Expand All @@ -219,7 +219,7 @@ macro_rules! __impl_external_bitflags_arbitrary {
}

/// Implement `Pod` and `Zeroable` for the internal bitflags type.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
#[cfg(feature = "bytemuck")]
macro_rules! __impl_external_bitflags_bytemuck {
Expand Down Expand Up @@ -247,7 +247,7 @@ macro_rules! __impl_external_bitflags_bytemuck {
};
}

#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
#[cfg(not(feature = "bytemuck"))]
macro_rules! __impl_external_bitflags_bytemuck {
Expand Down
4 changes: 2 additions & 2 deletions src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// Declare the `bitflags`-facing bitflags struct.
///
/// This type is part of the `bitflags` crate's public API, but not part of the user's.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
macro_rules! __declare_internal_bitflags {
(
Expand All @@ -25,7 +25,7 @@ macro_rules! __declare_internal_bitflags {
///
/// Methods and trait implementations can be freely added here without breaking end-users.
/// If we want to expose new functionality to `#[derive]`, this is the place to do it.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
macro_rules! __impl_internal_bitflags {
(
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ bitflags! {
}
```
*/
#[macro_export(local_inner_macros)]
#[macro_export]
macro_rules! bitflags {
(
$(#[$outer:meta])*
Expand Down Expand Up @@ -588,7 +588,7 @@ macro_rules! bitflags {
///
/// We need to be careful about adding new methods and trait implementations here because they
/// could conflict with items added by the end-user.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
macro_rules! __impl_bitflags {
(
Expand Down Expand Up @@ -797,7 +797,7 @@ macro_rules! __impl_bitflags {
///
/// If you find yourself with an attribute that should be considered expression-safe
/// and isn't, it can be added here.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
macro_rules! __bitflags_expr_safe_attrs {
// Entrypoint: Move all flags and all attributes into `unprocessed` lists
Expand Down Expand Up @@ -885,7 +885,7 @@ macro_rules! __bitflags_expr_safe_attrs {
}

/// Implement a flag, which may be a wildcard `_`.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
macro_rules! __bitflags_flag {
(
Expand Down
12 changes: 6 additions & 6 deletions src/public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// Declare the user-facing bitflags struct.
///
/// This type is guaranteed to be a newtype with a `bitflags`-facing type as its single field.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
macro_rules! __declare_public_bitflags {
(
Expand All @@ -22,7 +22,7 @@ macro_rules! __declare_public_bitflags {
///
/// We need to be careful about adding new methods and trait implementations here because they
/// could conflict with items added by the end-user.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
macro_rules! __impl_public_bitflags_forward {
(
Expand Down Expand Up @@ -124,7 +124,7 @@ macro_rules! __impl_public_bitflags_forward {
///
/// We need to be careful about adding new methods and trait implementations here because they
/// could conflict with items added by the end-user.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
macro_rules! __impl_public_bitflags {
(
Expand Down Expand Up @@ -268,7 +268,7 @@ macro_rules! __impl_public_bitflags {
}

/// Implement iterators on the public (user-facing) bitflags type.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
macro_rules! __impl_public_bitflags_iter {
($BitFlags:ident: $T:ty, $PublicBitFlags:ident) => {
Expand Down Expand Up @@ -312,7 +312,7 @@ macro_rules! __impl_public_bitflags_iter {
}

/// Implement traits on the public (user-facing) bitflags type.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
macro_rules! __impl_public_bitflags_ops {
($PublicBitFlags:ident) => {
Expand Down Expand Up @@ -472,7 +472,7 @@ macro_rules! __impl_public_bitflags_ops {
}

/// Implement constants on the public (user-facing) bitflags type.
#[macro_export(local_inner_macros)]
#[macro_export]
#[doc(hidden)]
macro_rules! __impl_public_bitflags_consts {
(
Expand Down

0 comments on commit 6511637

Please sign in to comment.