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

Implement Diagnostic for Report #307

Open
gavrilikhin-d opened this issue Oct 21, 2023 · 1 comment
Open

Implement Diagnostic for Report #307

gavrilikhin-d opened this issue Oct 21, 2023 · 1 comment

Comments

@gavrilikhin-d
Copy link
Contributor

gavrilikhin-d commented Oct 21, 2023

It looks like Report can be casted to diagnostic reference, since it implements AsRef<dyn Diagnostic + Send + Sync>.
But I can't find an implementation of Diagnostic for Report itself for some reason.

It could help you remove special case impl<C: SourceCode> Diagnostic for WithSourceCode<Report, C>

@TheLostLambda
Copy link
Contributor

I've accidentally asked the same in #366 ... It looks fundamentally like the ever-annoying coherence issue with impl From<T> for T in the standard library...

I might be possible to remove the From impl for Report, meaning you also lose .into(), but then there are a lot more internal challenges I can't particularly figure out... Tragically, this seems like a very very hard change to make...

Out of curiosity, why are you wanting Report to impl Diagnostic? Is it also for .report_err, or for something else?

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

No branches or pull requests

2 participants