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

feat(derive): enable more boxed types to be #[diagnostic_source] #338

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

TheLostLambda
Copy link
Contributor

Hello again! Nice and small change this time :)

The #[diagnostic_source] attribute already worked for Box<dyn Diagnostic>, but not for the highly-related Box<dyn Diagnostic + Send> and Box<dyn Diagnostic + Send + Sync> types!

It looks like someone already solved this issue for std::error:Error with a macro_rules! implementation, so I've done the same here to let those new cases compile! Without those Borrow<dyn Diagnostic> impls, you end up with compiler errors coming from inside of the derive macro:

Screenshot from 2024-02-06 20-26-45

Let me know if you have any questions! I'll separately try to sort out those failing tests (unrelated to this change) in another PR :)

@TheLostLambda
Copy link
Contributor Author

With some luck, #339 should fix the tests failing for everyone — I don't think there was a behavior change, I think the reference strings just got mangled somehow in a commit from three days ago.

Copy link
Owner

@zkat zkat left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for this!

@zkat zkat merged commit c2f06f6 into zkat:main Feb 7, 2024
1 of 14 checks passed
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