diff options
Diffstat (limited to 'macros')
-rw-r--r-- | macros/Cargo.toml | 1 | ||||
-rw-r--r-- | macros/src/lib.rs | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 205e9fe..ff55afe 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -26,7 +26,6 @@ proc-macro2 = "1.0.40" uuid = { version = "0.8", features = ["v4"] } regex = "1.6.0" once_cell = "1.13.1" -feature_macros = "0.1.0" [dev_dependencies] syrette = { version = "0.4.0", path = "..", features = ["factory"] } diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 8e906d0..293ac06 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -1,5 +1,4 @@ #![cfg_attr(doc_cfg, feature(doc_cfg))] -#![feature(proc_macro_hygiene)] #![deny(clippy::all)] #![deny(clippy::pedantic)] #![allow(clippy::module_name_repetitions)] @@ -7,7 +6,6 @@ //! Macros for the [Syrette](https://crates.io/crates/syrette) crate. -use feature_macros::feature_specific; use proc_macro::TokenStream; use quote::quote; use syn::{parse, parse_macro_input}; @@ -18,10 +16,12 @@ mod libs; mod macro_flag; mod util; -#[feature_specific("factory")] +#[cfg(feature = "factory")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "factory")))] mod factory; -#[feature_specific("factory")] +#[cfg(feature = "factory")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "factory")))] mod fn_trait; use crate::declare_interface_args::DeclareInterfaceArgs; @@ -193,7 +193,8 @@ pub fn injectable(args_stream: TokenStream, impl_stream: TokenStream) -> TokenSt /// ``` /// /// [`TransientPtr`]: https://docs.rs/syrette/latest/syrette/ptr/type.TransientPtr.html -#[feature_specific("factory")] +#[cfg(feature = "factory")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "factory")))] #[proc_macro_attribute] pub fn factory(args_stream: TokenStream, type_alias_stream: TokenStream) -> TokenStream { @@ -291,7 +292,8 @@ pub fn factory(args_stream: TokenStream, type_alias_stream: TokenStream) -> Toke /// declare_default_factory!(dyn IParser); /// ``` #[proc_macro] -#[feature_specific("factory")] +#[cfg(feature = "factory")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "factory")))] pub fn declare_default_factory(args_stream: TokenStream) -> TokenStream { use syn::parse_str; |