Skip to content

Disambiguate Error type in TryFrom#29

Merged
paholg merged 2 commits intopaholg:mainfrom
cmrschwarz:main
Mar 12, 2024
Merged

Disambiguate Error type in TryFrom#29
paholg merged 2 commits intopaholg:mainfrom
cmrschwarz:main

Conversation

@cmrschwarz
Copy link
Contributor

When trying to use subenum on an enum containing a variant named Error,
I got a compiler error, helpfully pointing me to this issue: rust-lang/rust#57644

This is due to the TryFrom implementation generated by subenum, where it is now ambiguous whether
Self::Error refers to the associated type TryFrom::Error or to the enum variant Error.

This PR fixes this by disambiguating in the return type of try_from.

@cmrschwarz
Copy link
Contributor Author

The CI errors on nightly seem unrelated to me, but let me know if there's anything I can do about that.

@paholg
Copy link
Owner

paholg commented Mar 12, 2024

Thanks for this!

I agree that the CI failures are unrelated. I'll go ahead and merge this, then fix the CI failures and make a release.

@paholg paholg merged commit bd8c572 into paholg:main Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants