8000 relax Debug impls to only require T::Key<'a>: Debug for a particular 'a by sunshowers · Pull Request #39 · oxidecomputer/iddqd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

relax Debug impls to only require T::Key<'a>: Debug for a particular 'a #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

sunshowers
Copy link
Collaborator
@sunshowers sunshowers commented Jun 6, 2025

This allows Debug with borrowed items to work in more circumstances.

We do have to use unsafe code, but that's okay because we have a T: 'a bound. This means that the key is valid for 'a, and in any case we discard the key immediately after calling its Debug impl.

It looks like we'll also have to do this for all the IdOrdMap mutable getters. That will come in the future.

Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
@sunshowers sunshowers merged commit 59cb718 into main Jun 6, 2025
18 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/relax-debug-impls-to-only-require-tkeya-debug-for-a-particular-a branch June 6, 2025 08:00
sunshowers added a commit that referenced this pull request Jun 6, 2025
Like in #39, we shouldn't require `Hash` on every `'k`, just on the
relevant `'a`.

The included test code would fail to compile without this change.
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.

1 participant
0