mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 15:07:59 +00:00
Fail test on warnings (#6043)
* fix (ci): hotfix Docker release * change (ci): fail test on warnings * change (config): stderr msgs * Fix the warnings properly Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api<Block: BlockT> {
|
||||
fn test();
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
error: `Block: BlockT` generic parameter will be added automatically by the `decl_runtime_apis!` macro! If you try to use a different trait than the substrate `Block` trait, please rename it locally.
|
||||
--> $DIR/declaring_old_block.rs:4:23
|
||||
--> $DIR/declaring_old_block.rs:2:23
|
||||
|
|
||||
4 | pub trait Api<Block: BlockT> {
|
||||
2 | pub trait Api<Block: BlockT> {
|
||||
| ^^^^^^
|
||||
|
||||
error: `Block: BlockT` generic parameter will be added automatically by the `decl_runtime_apis!` macro!
|
||||
--> $DIR/declaring_old_block.rs:4:16
|
||||
--> $DIR/declaring_old_block.rs:2:16
|
||||
|
|
||||
4 | pub trait Api<Block: BlockT> {
|
||||
2 | pub trait Api<Block: BlockT> {
|
||||
| ^^^^^
|
||||
|
||||
warning: unused import: `sp_runtime::traits::Block as BlockT`
|
||||
--> $DIR/declaring_old_block.rs:1:5
|
||||
|
|
||||
1 | use sp_runtime::traits::Block as BlockT;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(unused_imports)]` on by default
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api<B: BlockT> {
|
||||
fn test();
|
||||
|
||||
+2
-10
@@ -1,13 +1,5 @@
|
||||
error: `Block: BlockT` generic parameter will be added automatically by the `decl_runtime_apis!` macro! If you try to use a different trait than the substrate `Block` trait, please rename it locally.
|
||||
--> $DIR/declaring_own_block_with_different_name.rs:4:19
|
||||
--> $DIR/declaring_own_block_with_different_name.rs:2:19
|
||||
|
|
||||
4 | pub trait Api<B: BlockT> {
|
||||
2 | pub trait Api<B: BlockT> {
|
||||
| ^^^^^^
|
||||
|
||||
warning: unused import: `sp_runtime::traits::Block as BlockT`
|
||||
--> $DIR/declaring_own_block_with_different_name.rs:1:5
|
||||
|
|
||||
1 | use sp_runtime::traits::Block as BlockT;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(unused_imports)]` on by default
|
||||
|
||||
@@ -15,8 +15,6 @@ sp_api::decl_runtime_apis! {
|
||||
}
|
||||
|
||||
mod second {
|
||||
use super::*;
|
||||
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api {
|
||||
fn test2(data: u64);
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
error: Two traits with the same name detected! The trait name is used to generate its ID. Please rename one trait at the declaration!
|
||||
--> $DIR/impl_two_traits_with_same_name.rs:32:15
|
||||
--> $DIR/impl_two_traits_with_same_name.rs:30:15
|
||||
|
|
||||
32 | impl second::Api<Block> for Runtime {
|
||||
30 | impl second::Api<Block> for Runtime {
|
||||
| ^^^
|
||||
|
||||
warning: unused import: `super::*`
|
||||
--> $DIR/impl_two_traits_with_same_name.rs:18:6
|
||||
|
|
||||
18 | use super::*;
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(unused_imports)]` on by default
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
use substrate_test_runtime_client::runtime::Block;
|
||||
|
||||
struct Block2;
|
||||
|
||||
sp_api::decl_runtime_apis! {
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
error: Block type should be the same between all runtime apis.
|
||||
--> $DIR/mock_only_one_block_type.rs:22:12
|
||||
--> $DIR/mock_only_one_block_type.rs:20:12
|
||||
|
|
||||
22 | impl Api2<Block2> for MockApi {
|
||||
20 | impl Api2<Block2> for MockApi {
|
||||
| ^^^^^^
|
||||
|
||||
error: First block type found here
|
||||
--> $DIR/mock_only_one_block_type.rs:18:11
|
||||
--> $DIR/mock_only_one_block_type.rs:16:11
|
||||
|
|
||||
18 | impl Api<Block> for MockApi {
|
||||
16 | impl Api<Block> for MockApi {
|
||||
| ^^^^^
|
||||
|
||||
warning: unused import: `substrate_test_runtime_client::runtime::Block`
|
||||
--> $DIR/mock_only_one_block_type.rs:1:5
|
||||
|
|
||||
1 | use substrate_test_runtime_client::runtime::Block;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(unused_imports)]` on by default
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
use substrate_test_runtime_client::runtime::Block;
|
||||
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api {
|
||||
fn test(data: u64);
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
error: Self type should not change between runtime apis
|
||||
--> $DIR/mock_only_one_self_type.rs:21:23
|
||||
--> $DIR/mock_only_one_self_type.rs:19:23
|
||||
|
|
||||
21 | impl Api2<Block> for MockApi2 {
|
||||
19 | impl Api2<Block> for MockApi2 {
|
||||
| ^^^^^^^^
|
||||
|
||||
error: First self type found here
|
||||
--> $DIR/mock_only_one_self_type.rs:17:22
|
||||
--> $DIR/mock_only_one_self_type.rs:15:22
|
||||
|
|
||||
17 | impl Api<Block> for MockApi {
|
||||
15 | impl Api<Block> for MockApi {
|
||||
| ^^^^^^^
|
||||
|
||||
warning: unused import: `substrate_test_runtime_client::runtime::Block`
|
||||
--> $DIR/mock_only_one_self_type.rs:1:5
|
||||
|
|
||||
1 | use substrate_test_runtime_client::runtime::Block;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(unused_imports)]` on by default
|
||||
|
||||
Reference in New Issue
Block a user