Avoid ambiguous associated item references#646
Merged
Conversation
Signed-off-by: William Woodruff <william@astral.sh>
Contributor
Author
|
(For some background context: this is for some changes to uv that involve a new piece of metadata, which in turn needs to be given the rkyv treatment like the rest of our cacheable/serializable metadata types.) |
djkoloski
requested changes
Jan 7, 2026
Co-authored-by: David Koloski <djkoloski@gmail.com>
Signed-off-by: William Woodruff <william@astral.sh>
djkoloski
approved these changes
Jan 7, 2026
Contributor
Author
|
Oops, missed that formatting locally. Will fix. |
Signed-off-by: William Woodruff <william@astral.sh>
woodruffw
commented
Jan 7, 2026
| out: #rkyv_path::Place<Self::Archived>, | ||
| resolver: <Self as #rkyv_path::Archive>::Resolver, | ||
| out: #rkyv_path::Place< | ||
| <Self as #rkyv_path::Archive>::Archived>, |
Contributor
Author
There was a problem hiding this comment.
Not sure if this is the most ideal formatting 🙂
Collaborator
|
Thanks for the PR! I try to wait at least a week between releases, so this will be in the next release in about four days. |
Contributor
Author
Wonderful, thanks for the fast merge! |
6 tasks
Collaborator
|
A little late, but published now! |
Contributor
Author
|
Much appreciated! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello rkyv folks!
I noticed this while trying to derive
rkyv::Archiveon an enum that contains anArchivedvariant:yields the following error:
This is happening because
Archive(the trait) has an associated typeArchived, soSelf::Archiveambiguously refers to eitherArchive::Archivedor toProjectStatus::Archived.The solution to this is for the first-party to disambiguate its access. In this case that's as simple as
<Self as Archive>::Archived. This PR contains that change, plus its equivalent in the derive APIs.Note: I haven't attempted to suss out other ambiguous associated items, this is only one I happened to hit! So there are potentially others lurking.
Rust tracker: rust-lang/rust#57644