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

Improve errors #23

Merged
merged 1 commit into from
Jan 29, 2020
Merged

Improve errors #23

merged 1 commit into from
Jan 29, 2020

Conversation

TedDriggs
Copy link
Contributor

All macro validations now return spanned darling::Error instances.
This produces compile-time errors in the right places in input source code.

Largely fixes #7, though unwrap() calls can still cause the macro to fail.

PR Notes

  • Testing of the errors was done by deliberately breaking arbitrary_self.rs, but those changes weren't committed. It's possible to do compile-error tests for proc-macro crates, but it's not easy.
  • SelfType got some new methods to reduce boilerplate in other files.

All macro validations now return spanned darling::Error instances.
This produces compile-time errors in the right places in input source code.

Largely fixes nrxus#7, though unwrap() calls can still cause the macro to fail.
@nrxus nrxus merged commit b090c46 into nrxus:master Jan 29, 2020
@nrxus
Copy link
Owner

nrxus commented Jan 29, 2020

oh wow, thanks a lot for this, it looks great!

As long as all the current tests pass I am happy with this without adding tests that verify the compiler error messages.

Thanks!

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.

Better Errors
2 participants