From 8d8a19380a5fafe7c5cd0129b6c8e2e985d7593c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Wed, 30 Apr 2025 18:07:51 +0200 Subject: [PATCH] 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 --- xso-proc/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xso-proc/src/lib.rs b/xso-proc/src/lib.rs index 9045cee61bca4b1bce8bd8771c3911439aead362..8da74a0cf1007ba72fdd51103463525999f6e3ec 100644 --- a/xso-proc/src/lib.rs +++ b/xso-proc/src/lib.rs @@ -95,7 +95,7 @@ fn from_xml_impl(input: Item) -> Result { 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 { + fn try_from(other: ::xso::exports::minidom::Element) -> ::core::result::Result { ::xso::try_from_element(other) } }