diff --git a/crates/ruma-macros/src/identifiers.rs b/crates/ruma-macros/src/identifiers.rs index 42ea25b1..ae52e03d 100644 --- a/crates/ruma-macros/src/identifiers.rs +++ b/crates/ruma-macros/src/identifiers.rs @@ -128,6 +128,13 @@ pub fn expand_id_zst(input: ItemStruct) -> syn::Result { } } + #[automatically_derived] + impl #impl_generics AsRef<#id_ty> for #id_ty { + fn as_ref(&self) -> &#id_ty { + self + } + } + #[automatically_derived] impl #impl_generics AsRef for #id_ty { fn as_ref(&self) -> &str {