-
Notifications
You must be signed in to change notification settings - Fork 556
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
Add Debug
implementation with clippy
#5515
base: main
Are you sure you want to change the base?
Conversation
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.
Reviewed 26 of 129 files at r1, all commit messages.
Reviewable status: 26 of 129 files reviewed, 1 unresolved discussion (waiting on @tcoratger)
a discussion (no related file):
i'm not sure at all we actually want this - a lot of the crates are mostly internal crates that are not expected to be used by tools like cairo_native
and such - unless we have a lot of such cases where we have something missing - i'd rather avoid the additional costs of having it everywhere (in compile time).
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.
Reviewable status: 26 of 129 files reviewed, 1 unresolved discussion (waiting on @orizi)
a discussion (no related file):
Previously, orizi wrote…
i'm not sure at all we actually want this - a lot of the crates are mostly internal crates that are not expected to be used by tools like
cairo_native
and such - unless we have a lot of such cases where we have something missing - i'd rather avoid the additional costs of having it everywhere (in compile time).
Would you accept other PRs on a case by case basis? I would first think about ProgramRegistry
where a debug derivation would be more than useful for debugging in various tools.
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.
Reviewable status: 26 of 129 files reviewed, 1 unresolved discussion (waiting on @orizi)
a discussion (no related file):
Previously, tcoratger (Thomas Coratger) wrote…
Would you accept other PRs on a case by case basis? I would first think about
ProgramRegistry
where a debug derivation would be more than useful for debugging in various tools.
But on the other hand, I think that the Debug
derivation can be useful also inside the compiler itself for various debugging scenarios. And I don't have the impression that it increases the compilation time much. What do you think?
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.
Reviewable status: 26 of 129 files reviewed, 1 unresolved discussion (waiting on @tcoratger)
a discussion (no related file):
Previously, tcoratger (Thomas Coratger) wrote…
But on the other hand, I think that the
Debug
derivation can be useful also inside the compiler itself for various debugging scenarios. And I don't have the impression that it increases the compilation time much. What do you think?
a case by case basic would totally be fine - but particularly - the ProgramRegistry
sounds to me like an example of something that would be barely usable - as the Sierra Program
itself would be more useful to begin with.
We need to analyse it as a case by case to see if we need the debug - for a lot of existing structure adding such a debug might be more confusing (just because there's the entire DebugWithDb
structure all around the project, for salsa based stuff)
In circumstances like cairo_native, and other projects working on Cairo and its compilation, it is extremely useful to have a
Debug
implementation for each public structure and enum.Therefore, the lint
MISSING_DEBUG_IMPLEMENTATIONS
is added with a derivation ofDebug
wherever possible, along with anallow
attribute when the implementation is more complex.This allows for the implementation of
Debug
for a large number of new objects that did not previously have this implementation, with the potential for further refinement in the future.This change is