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

Use span_lint_hir() for more intuitive #[allow(...)] locations #132

Open
BD103 opened this issue Oct 10, 2024 · 0 comments
Open

Use span_lint_hir() for more intuitive #[allow(...)] locations #132

BD103 opened this issue Oct 10, 2024 · 0 comments
Labels
A-Linter Related to the linter and custom lints C-Usability An improvement that makes the API more pleasant

Comments

@BD103
Copy link
Member

BD103 commented Oct 10, 2024

span_lint_hir() can be used to emit a diagnostic for a different HirId, meaning a different location that can be silenced.

This is useful when we check one location for a lint, but emit the diagnostic in a separate location. The user may try #[allow(...)]-ing the lint at that separate location, but nothing will happen. Using span_lint_hir() can avoid this scenario.

@BD103 BD103 added A-Linter Related to the linter and custom lints C-Usability An improvement that makes the API more pleasant labels Oct 10, 2024
@BD103 BD103 added this to the `bevy_lint` 0.2.0 milestone Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Related to the linter and custom lints C-Usability An improvement that makes the API more pleasant
Projects
None yet
Development

No branches or pull requests

1 participant