Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 7a18534

Browse files
committed
Fix UI errors caused by upstream rustc diagnostic change
See rust-lang/rust#73996
1 parent d782a77 commit 7a18534

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

primitives/api/test/tests/ui/impl_incorrect_method_signature.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for tr
2323
17 | sp_api::impl_runtime_apis! {
2424
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found struct `std::string::String`
2525
|
26-
= note: expected fn pointer `fn(&RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall>, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<__SR_API_BLOCK__>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<_>) -> std::result::Result<_, _>`
27-
found fn pointer `fn(&RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall>, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<__SR_API_BLOCK__>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<std::string::String>, std::vec::Vec<_>) -> std::result::Result<_, _>`
26+
= note: expected fn pointer `fn(&RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall>, &BlockId<__SR_API_BLOCK__>, ExecutionContext, std::option::Option<u64>, Vec<_>) -> std::result::Result<_, _>`
27+
found fn pointer `fn(&RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall>, &BlockId<__SR_API_BLOCK__>, ExecutionContext, std::option::Option<std::string::String>, Vec<_>) -> std::result::Result<_, _>`
2828
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
2929

3030
error[E0308]: mismatched types

primitives/api/test/tests/ui/mock_only_one_error_type.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: Error type can not change between runtime apis
44
23 | type Error = u64;
55
| ^^^^
66

7-
error[E0277]: the trait bound `u32: std::convert::From<std::string::String>` is not satisfied
7+
error[E0277]: the trait bound `u32: From<String>` is not satisfied
88
--> $DIR/mock_only_one_error_type.rs:15:1
99
|
1010
15 | / sp_api::mock_impl_runtime_apis! {
@@ -14,17 +14,17 @@ error[E0277]: the trait bound `u32: std::convert::From<std::string::String>` is
1414
... |
1515
26 | | }
1616
27 | | }
17-
| |_^ the trait `std::convert::From<std::string::String>` is not implemented for `u32`
18-
|
19-
::: $WORKSPACE/primitives/api/src/lib.rs:350:35
17+
| |_^ the trait `From<String>` is not implemented for `u32`
2018
|
21-
350 | type Error: std::fmt::Debug + From<String>;
22-
| ------------ required by this bound in `sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ApiErrorExt`
19+
::: $WORKSPACE/primitives/api/src/lib.rs
20+
|
21+
| type Error: std::fmt::Debug + From<String>;
22+
| ------------ required by this bound in `ApiErrorExt`
2323
|
2424
= help: the following implementations were found:
25-
<u32 as std::convert::From<bool>>
26-
<u32 as std::convert::From<char>>
27-
<u32 as std::convert::From<h2::frame::reason::Reason>>
28-
<u32 as std::convert::From<h2::frame::reason::Reason>>
25+
<u32 as From<HttpError>>
26+
<u32 as From<HttpRequestId>>
27+
<u32 as From<HttpRequestStatus>>
28+
<u32 as From<Ipv4Addr>>
2929
and 18 others
3030
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

primitives/api/test/tests/ui/mock_only_self_reference.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for tr
2424
12 | sp_api::mock_impl_runtime_apis! {
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `()`
2626
|
27-
= note: expected fn pointer `fn(&MockApi, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime_client::substrate_test_runtime::Extrinsic>>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<_>) -> std::result::Result<_, _>`
28-
found fn pointer `fn(&MockApi, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime_client::substrate_test_runtime::Extrinsic>>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<()>, std::vec::Vec<_>) -> std::result::Result<_, _>`
27+
= note: expected fn pointer `fn(&MockApi, &BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, Extrinsic>>, ExecutionContext, Option<u64>, Vec<_>) -> std::result::Result<_, _>`
28+
found fn pointer `fn(&MockApi, &BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, Extrinsic>>, ExecutionContext, Option<()>, Vec<_>) -> std::result::Result<_, _>`
2929
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
3030

3131
error[E0053]: method `Api_test2_runtime_api_impl` has an incompatible type for trait
@@ -42,6 +42,6 @@ error[E0053]: method `Api_test2_runtime_api_impl` has an incompatible type for t
4242
12 | sp_api::mock_impl_runtime_apis! {
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `()`
4444
|
45-
= note: expected fn pointer `fn(&MockApi, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime_client::substrate_test_runtime::Extrinsic>>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<_>) -> std::result::Result<_, _>`
46-
found fn pointer `fn(&MockApi, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime_client::substrate_test_runtime::Extrinsic>>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<()>, std::vec::Vec<_>) -> std::result::Result<_, _>`
45+
= note: expected fn pointer `fn(&MockApi, &BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, Extrinsic>>, ExecutionContext, Option<u64>, Vec<_>) -> std::result::Result<_, _>`
46+
found fn pointer `fn(&MockApi, &BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, Extrinsic>>, ExecutionContext, Option<()>, Vec<_>) -> std::result::Result<_, _>`
4747
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

primitives/api/test/tests/ui/type_reference_in_impl_runtime_apis_call.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for tr
2323
17 | sp_api::impl_runtime_apis! {
2424
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `&u64`
2525
|
26-
= note: expected fn pointer `fn(&RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall>, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<__SR_API_BLOCK__>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<_>) -> std::result::Result<_, _>`
27-
found fn pointer `fn(&RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall>, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<__SR_API_BLOCK__>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<&u64>, std::vec::Vec<_>) -> std::result::Result<_, _>`
26+
= note: expected fn pointer `fn(&RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall>, &BlockId<__SR_API_BLOCK__>, ExecutionContext, std::option::Option<u64>, Vec<_>) -> std::result::Result<_, _>`
27+
found fn pointer `fn(&RuntimeApiImpl<__SR_API_BLOCK__, RuntimeApiImplCall>, &BlockId<__SR_API_BLOCK__>, ExecutionContext, std::option::Option<&u64>, Vec<_>) -> std::result::Result<_, _>`
2828
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
2929

3030
error[E0308]: mismatched types

0 commit comments

Comments
 (0)