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

Export default diagnostics extractors #289

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

DaniPopes
Copy link
Contributor

@DaniPopes DaniPopes commented Oct 14, 2024

The config diagnostic_extractors provided by the rustc feature are not exported but reachable through Config::{cargo,rustc}().diagnostic_extractor; making these public would let users import the function directly instead of having it to access it through Config methods.
I've renamed them and moved them to the diagnostics module, as well as added the default one as a separate function.

My use case for this is I am testing another compiler that can emit JSON diagnostics using the rustc format, but everything else about the configuration will be different, so it doesn't really make sense to call Config::rustc if it wasn't for this method.

BTW I was able to migrate to this library from a compiletest-rs fork pretty easily, thanks a lot for developing this!

@DaniPopes DaniPopes force-pushed the pub-diagnostics-extractors branch from 29cf9b1 to 3482024 Compare October 14, 2024 13:10
Copy link
Owner

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. It should be possible to build a rustc config manually without the rustc constructor function. There's still more I need to expose, but this is an important piece

src/diagnostics.rs Outdated Show resolved Hide resolved
@DaniPopes DaniPopes force-pushed the pub-diagnostics-extractors branch from 3482024 to 0911fb4 Compare October 14, 2024 13:37
@oli-obk oli-obk merged commit fb3c75b into oli-obk:main Oct 14, 2024
8 checks passed
@DaniPopes DaniPopes deleted the pub-diagnostics-extractors branch October 14, 2024 14:06
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.

2 participants