From 97c789e38bb8e61389a3808d241689e623144344 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 3 Oct 2022 20:23:26 +0200 Subject: refactor: remove relying on Rust nightly for better handling of features --- macros/src/lib.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'macros/src') 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; -- cgit v1.2.3-18-g5258