mockers uses compiler plugin to provide custom
#[derive(Mock)] attribute. After some of latest nightly rustc releasesa all uses of this attribute causes “unused attribute” to be emitted.
Is this bug?
You need to register an attribute into the registry. http://manishearth.github.io/rust-internals-docs/rustc_plugin/registry/struct.Registry.html#method.register_attribute
I register my custom attribute with
I have tried both
but warning is still emitted.
@kriomant Thanks for the report!
The unused attribute warnings are actually from the
#[cfg(test)] attributes on the items that
derive_Mock creates. These decorator-generated items stopped being
cfg-processed in https://github.com/rust-lang/rust/pull/33706.
I fixed this in https://github.com/rust-lang/rust/pull/34295 – the warnings should go away once it lands.
You are right — they have gone! Thank you!
Yes, latest nightly is fine. Thank you again