Skip to content
Snippets Groups Projects
Commit ea58b7c9 authored by Bastian Köcher's avatar Bastian Köcher Committed by David Craven
Browse files

Make `DefaultByte` implement `Send + Sync` (#3333)

* Make `DefaultByte` implement `Send + Sync`

* Update runtime version.
parent 46709e83
No related merge requests found
......@@ -81,7 +81,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 131,
impl_version: 132,
impl_version: 133,
apis: RUNTIME_API_VERSIONS,
};
......
......@@ -210,7 +210,7 @@ pub struct ModuleConstantMetadata {
}
/// A technical trait to store lazy initiated vec value as static dyn pointer.
pub trait DefaultByte {
pub trait DefaultByte: Send + Sync {
fn default_byte(&self) -> Vec<u8>;
}
......
......@@ -1069,6 +1069,12 @@ fn store_functions_to_metadata (
}
}
unsafe impl<#traitinstance: #traittype, #instance #bound_instantiable> Send
for #struct_name<#traitinstance, #instance> #where_clause {}
unsafe impl<#traitinstance: #traittype, #instance #bound_instantiable> Sync
for #struct_name<#traitinstance, #instance> #where_clause {}
#[cfg(not(feature = "std"))]
impl<#traitinstance: #traittype, #instance #bound_instantiable> #scrate::metadata::DefaultByte
for #struct_name<#traitinstance, #instance> #where_clause
......
......@@ -1431,6 +1431,14 @@ macro_rules! __impl_module_constants_metadata {
$crate::dispatch::Encode::encode(&value)
}
}
unsafe impl<$const_trait_instance: 'static + $const_trait_name $(
<I>, $const_instance: $const_instantiable)?
> Send for $default_byte_name <$const_trait_instance $(, $const_instance)?> {}
unsafe impl<$const_trait_instance: 'static + $const_trait_name $(
<I>, $const_instance: $const_instantiable)?
> Sync for $default_byte_name <$const_trait_instance $(, $const_instance)?> {}
)*
&[
$(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment