xso-proc: avoid an ambiguous_associated_items error

rustc forbids cases where an enum variant and an associated type of a
trait conflict for a while now [1].

We must thus avoid referring to associated items on types we do not
control in the macros. There was only one case I found, and it was in
the TryFrom implementation, and could be easily resolved by explicitly
spelling out Self::Error.

   [1]: https://github.com/rust-lang/rust/issues/57644
This commit is contained in:
Jonas Schäfer 2025-04-30 18:07:51 +02:00 committed by Link Mauve
commit 8d8a19380a

View file

@ -95,7 +95,7 @@ fn from_xml_impl(input: Item) -> Result<TokenStream> {
impl ::core::convert::TryFrom<::xso::exports::minidom::Element> for #ident {
type Error = ::xso::error::FromElementError;
fn try_from(other: ::xso::exports::minidom::Element) -> ::core::result::Result<Self, Self::Error> {
fn try_from(other: ::xso::exports::minidom::Element) -> ::core::result::Result<Self, ::xso::error::FromElementError> {
::xso::try_from_element(other)
}
}