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

Make macro emit a warning instead of an error? #2

Open
Xaeroxe opened this issue May 14, 2023 · 3 comments
Open

Make macro emit a warning instead of an error? #2

Xaeroxe opened this issue May 14, 2023 · 3 comments

Comments

@Xaeroxe
Copy link

Xaeroxe commented May 14, 2023

I believe it should be possible to emit a warning, using proc_macro::Diagnostic. With that in mind, I believe it'd be preferable to have the default behavior be to warn, and then opt in to it being an error.

This also helps with #1, because when a dependency emits a warning Cargo silently ignores it.

@Xaeroxe
Copy link
Author

Xaeroxe commented May 14, 2023

Though I suppose this only works with a nightly compiler

@parker-codes
Copy link
Owner

I'm investigating a solution in #5. Ideally we could show an error/warning in the editor and only log out warnings for the current project. Since diagnostics are not on stable Rust, in #1 someone showed how to use a deprecated mark to almost do the same thing. It works really well, except it creates a strikethrough effect in the editor which makes it hard to read.

@parker-codes
Copy link
Owner

Just merged the PR to not fail builds. It still fails tests though, so I'll be looking for a solution to that.

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