Skip to content

Commit 08f29af

Browse files
committed
sp-api: Sprinkle some automatically_derived attributes
This attribute is informing tooling that the code is automatically derived and thus, should not enable any linting.
1 parent 2858cbc commit 08f29af

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ fn generate_runtime_api_base_structures() -> Result<TokenStream> {
275275
extensions_generated_for: std::cell::RefCell<std::option::Option<Block::Hash>>,
276276
}
277277

278+
#[automatically_derived]
278279
impl<Block: #crate_::BlockT, C: #crate_::CallApiAt<Block>> #crate_::ApiExt<Block> for
279280
RuntimeApiImpl<Block, C>
280281
{
@@ -367,6 +368,7 @@ fn generate_runtime_api_base_structures() -> Result<TokenStream> {
367368
}
368369
}
369370

371+
#[automatically_derived]
370372
impl<Block: #crate_::BlockT, C> #crate_::ConstructRuntimeApi<Block, C>
371373
for RuntimeApi
372374
where
@@ -389,6 +391,7 @@ fn generate_runtime_api_base_structures() -> Result<TokenStream> {
389391
}
390392
}
391393

394+
#[automatically_derived]
392395
impl<Block: #crate_::BlockT, C: #crate_::CallApiAt<Block>> RuntimeApiImpl<Block, C> {
393396
fn commit_or_rollback_transaction(&self, commit: bool) {
394397
let proof = "\
@@ -685,9 +688,11 @@ fn generate_api_impl_for_runtime_api(impls: &[ItemImpl]) -> Result<TokenStream>
685688
// remove the trait to get just the module path
686689
runtime_mod_path.segments.pop();
687690

688-
let processed_impl =
691+
let mut processed_impl =
689692
ApiRuntimeImplToApiRuntimeApiImpl { runtime_block }.process(impl_.clone());
690693

694+
processed_impl.attrs.push(parse_quote!(#[automatically_derived]));
695+
691696
result.push(processed_impl);
692697
}
693698

0 commit comments

Comments
 (0)