Allow proc_macro functions to whitelist specific attributes
By using a second attribute `attributes(Bar)` on proc_macro_derive, whitelist any attributes with the name `Bar` in the deriving item. This allows a proc_macro function to use custom attribtues without a custom attribute error or unused attribute lint.
This commit is contained in:
@@ -95,7 +95,8 @@ pub mod __internal {
|
||||
pub trait Registry {
|
||||
fn register_custom_derive(&mut self,
|
||||
trait_name: &str,
|
||||
expand: fn(TokenStream) -> TokenStream);
|
||||
expand: fn(TokenStream) -> TokenStream,
|
||||
attributes: &[&'static str]);
|
||||
}
|
||||
|
||||
// Emulate scoped_thread_local!() here essentially
|
||||
|
||||
Reference in New Issue
Block a user