-
Notifications
You must be signed in to change notification settings - Fork 188
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
added missing_debug_implementations lint #2016
Conversation
Hey @g4titanx, thanks for the great work here! In the issue comment you mention that:
Do you still have some public types missing, or you managed to do all the public types? Would you mind pointing to the types you had difficulties to? Thank you! |
yeah, check: and think I covered the rest |
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.
Thank you @g4titanx for the effort here!
So, for the missing types, it is related to the traits bounds.
Let's take this trait:
pub trait EventProcessor<P>
where
P: Provider + Sync,
{...}
There's nothing that bounds P
to the Debug
trait. As there are some dyn
used, the compiler must also know that the types implement Debug
.
pub trait EventProcessor<P>
where
P: Provider + Sync + std::fmt::Debug,
{...}
This is what's missing.
So you may now have to track the traits and ensure the std::fmt::Debug
bound is always present.
This is why for instance in Processor
type in engine.rs
you couldn't have #[derive(Debug)]
working.
If you have any question please don't hesitate.
oh great! i would make the changes |
hi @glihm , in the recent commit i made, i added the Debug traits to the trait bounds and i am still getting a compiler error that says the types that implement also, i am getting a conflicting implementation of traits |
Will check, but did you add the trait bound to all other possible related traits? |
yeah, I added it to all related traits. you can check the latest commit
okay, I am gonna try this now |
i think the issue here stems from how Rust treats dynamic dispatch trait objects. for example, what do you think? that's about the only error i am getting right now tho. no error with |
Thank you for the feedback and researches on that!
@tcoratger may have other experience with that? On my end, it seems the only way with Could you update the PR by only enforcing the trait bound and see how it looks? To avoid creating a wrapper in a first time and only having the bound check passing. WDYT? |
you are welcome!
i did that in my local repo, the error was persistent. i will enforce on the trait bound and push, so you can see it |
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 50 files out of 106 files are above the max files limit of 50. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Thanks for the work here @g4titanx and your time on that. 🙏
I've merged main and added missing Debug
. I've also tried to solution at trait level where Debug
is required, but this may require a bigger change as we didn't build with this in mind.
So currently, there's several types with #[allow(missing_debug_implementation)]
when it comes to futures or external types not having Debug
.
@kariy @lambda-0x we may refactor in the future to gate Debug under a feature to not generate too much code when not required.
For now, I suppose the PR in it's state is ok to be reviewed and possibly merged to at least ensure most of the types derive Debug
.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2016 +/- ##
=======================================
Coverage 67.99% 68.00%
=======================================
Files 331 331
Lines 42679 42679
=======================================
+ Hits 29021 29024 +3
+ Misses 13658 13655 -3 ☔ View full report in Codecov by Sentry. |
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.
lgtm
great! |
Description:
added the missing_debug_implementations lint which detects missing implementations of #[deive(Debug)] for public types.
Related issue: #1841