diff --git a/crates/ruma-events-macros/src/event.rs b/crates/ruma-events-macros/src/event.rs index 825bf7d1..aa920064 100644 --- a/crates/ruma-events-macros/src/event.rs +++ b/crates/ruma-events-macros/src/event.rs @@ -410,7 +410,9 @@ fn expand_from_into( let full_struct = kind.to_event_ident(&var.to_full_variation()); Some(quote! { #[automatically_derived] - impl #impl_generics From<#full_struct #ty_gen> for #ident #ty_gen #where_clause { + impl #impl_generics ::std::convert::From<#full_struct #ty_gen> + for #ident #ty_gen #where_clause + { fn from(event: #full_struct #ty_gen) -> Self { let #full_struct { #( #fields, )* .. } = event; Self { #( #fields, )* } diff --git a/crates/ruma-events-macros/src/event_enum.rs b/crates/ruma-events-macros/src/event_enum.rs index 4b6df45a..ce3c2743 100644 --- a/crates/ruma-events-macros/src/event_enum.rs +++ b/crates/ruma-events-macros/src/event_enum.rs @@ -201,7 +201,7 @@ fn expand_from_impl( quote! { #[automatically_derived] #(#attrs)* - impl From<#content> for #ty { + impl ::std::convert::From<#content> for #ty { fn from(c: #content) -> Self { Self::#ident(c) } @@ -228,7 +228,7 @@ fn expand_conversion_impl( let self_variants = variants.iter().map(|v| v.ctor(quote! { Self })); Some(quote! { - impl From<#ident> for #sync { + impl ::std::convert::From<#ident> for #sync { fn from(event: #ident) -> Self { match event { #( @@ -996,7 +996,7 @@ pub(crate) fn expand_from_impls_derived(input: DeriveInput) -> TokenStream { let var_ident = &variant.ident; let id = &input.ident; quote! { - impl From<#inner_struct> for #id { + impl ::std::convert::From<#inner_struct> for #id { fn from(c: #inner_struct) -> Self { Self::#var_ident(c) }