-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Implement a command to dump impls for a given type #7322
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
CodSpeed Performance ReportMerging #7322 will not alter performanceComparing Summary
|
Would make sense to use the "trait" or the "impl_for" span instead of the whole declaration? That would always show the start of the impl, and would give more uniform results.
|
Great suggestion, it indeed looks much better, I have updated the implementation and the screenshots in the PR description. Also improved the implementation to handle enums as previously only structs were supported. |
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.
Very nice, but we need some tests for this.
Snapshots should do well here.
Added some tests. |
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.
That's a good start on the tests, but this is just the happy path, we should also check whether the impls still get captured:
- when they are in a different file/module
- when they are in a different package altogether
This adds a new `--dump-impls` CLI command that can be used to dump all the recognized trait impls for a given type name. This also extends the compiler diagnostic system to allow the emission of info diagnostics, as previously we could only emit either warnings of errors, which did not fit this. Closes FuelLabs#7286.
Updated with these. |
This adds a new
--dump-impls
CLI command that can be used to dump all the recognized trait impls for a given type name.This also extends the compiler diagnostic system to allow the emission of info diagnostics, as previously we could only emit either warnings of errors, which did not fit this use case.
Description
For example, here is the output of
cargo run --bin forc -- build --path _test-case --dump-impls=std::string::String
:And for enums:
Closes #7286.
Checklist
Breaking*
orNew Feature
labels where relevant.