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
Fix debug printing for dynamic types #10740
Merged
Merged
Conversation
This file contains 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
MrGVSV
reviewed
Nov 25, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m going to guess all of the dynamic types are broken in this way. Could we fix all of them in this PR as well? If not, we can tackle it in another PR.
Might also be worth adding tests to ensure our |
alice-i-cecile
added
C-Bug
An unexpected or incorrect behavior
A-Reflection
Runtime information about types
labels
Nov 26, 2023
mockersf
approved these changes
Nov 27, 2023
Davier
changed the title
Fix DynamicStruct debug printing
Fix debug printing for dynamic types
Nov 27, 2023
Davier
force-pushed
the
dyn_struct_debug_fix
branch
from
November 29, 2023 09:48
08a5da6
to
a35981b
Compare
I rebased to resolve merge conflicts. |
MrGVSV
reviewed
Dec 2, 2023
rlidwka
reviewed
Dec 5, 2023
rlidwka
approved these changes
Dec 7, 2023
MrGVSV
approved these changes
Dec 8, 2023
MrGVSV
added
the
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
label
Dec 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Reflection
Runtime information about types
C-Bug
An unexpected or incorrect behavior
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
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.
Objective
Printing
DynamicStruct
with a debug format does not show the contained type anymore. For instance, inexamples/reflection/reflection.rs
, addingdbg!(&reflect_value);
to line 96 will print:Solution
Show the represented type instead (
reflection::Foo
andreflection::Bar
in this case):