-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Converting a Report
to a Box<dyn Diagnostic>
wipes all Diagnostic
information
#369
Comments
Much more mundane than I thought... I've got a fix that I'll make a PR for! |
TheLostLambda
added a commit
to TheLostLambda/miette
that referenced
this issue
Apr 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I suspect this is a super subtle issue in the crazy vtable code, but here is a relatively compact reproduction of the issue:
The
Error
/Display
impl is still totally okay, and all of theDiagnostic
stuff that goes though theDeref
impl seems to work fine — both.as_ref()
and calling things like.code()
on aReport
directly — so the issue does not seem to be present here:NOTE: I'm now moving away from the example above, to the context where this issue occurs in my code!
The issue seems to come specifically from (I believe) somehow attaching the wrong vtable? Here the data of the error stays the same — the source code information is kept — but calling
.source_code()
seems to just fall back on the defaultNone
impl?Outputs, in my case:
The
error
andres
structs remain the same, but calling the.source_code()
method does not!Any pointers on where to start fixing this would be excellent! The unsafe vtable code is beyond anything I've ever done in Rust, so figuring it out is a gradual process...
The text was updated successfully, but these errors were encountered: