You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to use Cargo features and cfg_attr in order to be able to activate/deactivate the compilation of metering or change which set of functions is going to be measured. However, I ran into the problem that cfg_attr complained about measure not being an attribute.
Current workaround which helps at least for being able to completly disable compilation with metered: Create a fake attribute macro called measure in a proc-macro crate, in this example named "my-macros":
/// No-op macro as work-around for https://github.com/magnet/metered-rs/issues/23.#[doc(hidden)]#[proc_macro_attribute]pubfnmeasure(_:TokenStream,input:TokenStream) -> TokenStream{
input
}
First: Extremely practical crate! Thanks!
I wanted to use Cargo features and
cfg_attr
in order to be able to activate/deactivate the compilation of metering or change which set of functions is going to be measured. However, I ran into the problem thatcfg_attr
complained aboutmeasure
not being an attribute.Example:
Is there any way to fix it? E.g. to make
measure
an actual attribute?The text was updated successfully, but these errors were encountered: