Repository navigation
Add undocumented_as_casts lint - #16682
charlieHsiuC wants to merge 4 commits into
Conversation
|
rustbot has assigned @samueltardieu. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Lintcheck changes for 99f42bd
This comment will be updated if you push new changes |
|
Reminder, once the PR becomes ready for a review, use |
|
This lint has been nominated for inclusion. |
|
Hi, @samueltardieu @rustbot ready |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
To allow the existing projects to gradually adopt this lint, I have added configurations to enable checks for specific scenarios that users may be most concerned about. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…dd test case for declared macro
- Refactored the linting logic to utilize `span_lint_and_then` for better suggestion handling. - Updated the comment checking mechanism to ensure `// CAST:` comments are properly validated, including for casts originating from macro expansions. - Improved documentation within the lint to clarify the requirements for cast comments. - Adjusted test cases to cover new scenarios and ensure compliance with the updated linting rules. - Refine `undocumented_as_casts` lint error messages for clarity
6558abe to
99f42bd
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Hi @samueltardieu, Could you review this PR when you have a chance? I'm looking for some feedback to get it ready for merging. Based on your suggestions, I added support for macros. I also updated the lint to show different messages when it triggers inside a macro, which is why I think using I initially tried to reuse the logic from undocumented_unsafe_block, but I felt it gave the comments too much flexibility in terms of placement. Instead, I kept it simple and changed it to only expect comments right before the linted span. |
|
☔ The latest upstream changes (possibly #13598) made this pull request unmergeable. Please resolve the merge conflicts. |
Checks for
ascasts that do not have a preceding// CAST:comment.fixes #15963
changelog: new lint: [
undocumented_as_casts]