Skip to content
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

Lift trait bounds from #[debug(skip)] fields (#281) #283

Merged
merged 4 commits into from
Jul 31, 2023

Conversation

tyranron
Copy link
Collaborator

Resolves #281

Synopsis

See #281:

struct NoDebug;
                                     
#[derive(derive_more::Debug)]
struct HasDebug<T>(#[debug(skip)] T);
                                     
dbg!(HasDebug(NoDebug));

I'd be fine with needing to manually specify something like #[debug(bounds())].

Solution

Fix how ignore/skip attributes are considered in bounding of derive(Debug) macro.

Checklist

  • Documentation is updated (not required)
  • Tests are added/updated
  • CHANGELOG entry is added (not required)

@tyranron tyranron added this to the 1.0.0 milestone Jul 27, 2023
@tyranron tyranron self-assigned this Jul 27, 2023
@tyranron tyranron requested a review from JelteF July 27, 2023 15:25
@ModProg
Copy link
Contributor

ModProg commented Jul 27, 2023

should there be a test case for a custom field format?

@tyranron
Copy link
Collaborator Author

@ModProg done.

@tyranron tyranron merged commit ad301a4 into master Jul 31, 2023
16 checks passed
@tyranron tyranron deleted the 281-fix-debug-bounds branch July 31, 2023 09:56
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.

Redundant bound for Debug on skipped field/make display(bound) do the same as debug(bound)
3 participants