diff --git a/substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs b/substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs index 642da2c465..85ba078810 100644 --- a/substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs +++ b/substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs @@ -202,11 +202,7 @@ fn generate_runtime_api_base_structures() -> Result { pub struct RuntimeApi {} /// Implements all runtime apis for the client side. #[cfg(any(feature = "std", test))] - pub struct RuntimeApiImpl + 'static> - where - // Rust bug: https://github.com/rust-lang/rust/issues/24159 - C::StateBackend: #crate_::StateBackend<#crate_::HashFor>, - { + pub struct RuntimeApiImpl + 'static> { call: &'static C, commit_on_success: std::cell::RefCell, initialized_block: std::cell::RefCell>>, @@ -223,25 +219,16 @@ fn generate_runtime_api_base_structures() -> Result { #[cfg(any(feature = "std", test))] unsafe impl> Send for RuntimeApiImpl - where - // Rust bug: https://github.com/rust-lang/rust/issues/24159 - C::StateBackend: #crate_::StateBackend<#crate_::HashFor>, {} #[cfg(any(feature = "std", test))] unsafe impl> Sync for RuntimeApiImpl - where - // Rust bug: https://github.com/rust-lang/rust/issues/24159 - C::StateBackend: #crate_::StateBackend<#crate_::HashFor>, {} #[cfg(any(feature = "std", test))] impl> #crate_::ApiExt for RuntimeApiImpl - where - // Rust bug: https://github.com/rust-lang/rust/issues/24159 - C::StateBackend: #crate_::StateBackend<#crate_::HashFor>, { type StateBackend = C::StateBackend; @@ -319,8 +306,6 @@ fn generate_runtime_api_base_structures() -> Result { for RuntimeApi where C: #crate_::CallApiAt + 'static, - // Rust bug: https://github.com/rust-lang/rust/issues/24159 - C::StateBackend: #crate_::StateBackend<#crate_::HashFor>, { type RuntimeApi = RuntimeApiImpl; @@ -339,11 +324,7 @@ fn generate_runtime_api_base_structures() -> Result { } #[cfg(any(feature = "std", test))] - impl> RuntimeApiImpl - where - // Rust bug: https://github.com/rust-lang/rust/issues/24159 - C::StateBackend: #crate_::StateBackend<#crate_::HashFor>, - { + impl> RuntimeApiImpl { fn call_api_at< R: #crate_::Encode + #crate_::Decode + PartialEq, F: FnOnce( diff --git a/substrate/test-utils/runtime/client/src/block_builder_ext.rs b/substrate/test-utils/runtime/client/src/block_builder_ext.rs index bb0f2d400b..0d3211fa05 100644 --- a/substrate/test-utils/runtime/client/src/block_builder_ext.rs +++ b/substrate/test-utils/runtime/client/src/block_builder_ext.rs @@ -20,7 +20,6 @@ use sp_api::{ApiExt, ProvideRuntimeApi}; use sp_core::ChangesTrieConfiguration; use sc_client_api::backend; -use sp_runtime::traits::HashFor; use sc_block_builder::BlockBuilderApi; @@ -49,9 +48,6 @@ impl<'a, A, B> BlockBuilderExt for sc_block_builder::BlockBuilder<'a, substrate_ StateBackend = backend::StateBackendFor >, B: backend::Backend, - // Rust bug: https://github.com/rust-lang/rust/issues/24159 - backend::StateBackendFor: - sp_api::StateBackend>, { fn push_transfer(&mut self, transfer: substrate_test_runtime::Transfer) -> Result<(), sp_blockchain::Error> { self.push(transfer.into_signed_tx()) diff --git a/substrate/test-utils/runtime/client/src/lib.rs b/substrate/test-utils/runtime/client/src/lib.rs index c8d11c9b62..5a66cde62e 100644 --- a/substrate/test-utils/runtime/client/src/lib.rs +++ b/substrate/test-utils/runtime/client/src/lib.rs @@ -249,9 +249,6 @@ impl TestClientBuilderExt for TestClientBuilder< B > where B: sc_client_api::backend::Backend + 'static, - // Rust bug: https://github.com/rust-lang/rust/issues/24159 - >::State: - sp_api::StateBackend>, { fn genesis_init_mut(&mut self) -> &mut GenesisParameters { Self::genesis_init_mut(self) diff --git a/substrate/test-utils/runtime/client/src/trait_tests.rs b/substrate/test-utils/runtime/client/src/trait_tests.rs index 32d94dd618..797c7ec089 100644 --- a/substrate/test-utils/runtime/client/src/trait_tests.rs +++ b/substrate/test-utils/runtime/client/src/trait_tests.rs @@ -30,16 +30,13 @@ use sc_client_api::blockchain::{Backend as BlockChainBackendT, HeaderBackend}; use sp_consensus::BlockOrigin; use substrate_test_runtime::{self, Transfer}; use sp_runtime::generic::BlockId; -use sp_runtime::traits::{Block as BlockT, HashFor}; +use sp_runtime::traits::Block as BlockT; use sc_block_builder::BlockBuilderProvider; use futures::executor::block_on; /// helper to test the `leaves` implementation for various backends pub fn test_leaves_for_backend(backend: Arc) where B: backend::Backend, - // Rust bug: https://github.com/rust-lang/rust/issues/24159 - backend::StateBackendFor: - sp_api::StateBackend>, { // block tree: // G -> A1 -> A2 -> A3 -> A4 -> A5 @@ -206,9 +203,6 @@ pub fn test_leaves_for_backend(backend: Arc) where /// helper to test the `children` implementation for various backends pub fn test_children_for_backend(backend: Arc) where B: backend::LocalBackend, - // Rust bug: https://github.com/rust-lang/rust/issues/24159 - >::State: - sp_api::StateBackend>, { // block tree: // G -> A1 -> A2 -> A3 -> A4 -> A5 @@ -334,11 +328,9 @@ pub fn test_children_for_backend(backend: Arc) where assert_eq!(vec![b3.hash(), c3.hash()], children4); } -pub fn test_blockchain_query_by_number_gets_canonical(backend: Arc) where +pub fn test_blockchain_query_by_number_gets_canonical(backend: Arc) +where B: backend::LocalBackend, - // Rust bug: https://github.com/rust-lang/rust/issues/24159 - >::State: - sp_api::StateBackend>, { // block tree: // G -> A1 -> A2 -> A3 -> A4 -> A5