Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates existing Dylint rule crates to the latest Dylint/rustc lint emission API (moving from span_lint-style closures to emit_span_lint with a Diagnostic implementor), along with some minor CI YAML refactoring and dependency lockfile refresh. It also removes the panic_usage rule crate from the workspace/repo.
Changes:
- Migrate rule diagnostics to
emit_span_lintby introducing aLintMsgwrapper implementingrustc_errors::Diagnostic. - Remove the
rules/panic_usagerule crate (source + UI tests + docs/config) and drop it from the workspace. - Refresh
Cargo.lockand tidy.github/workflows/ci.yamlstep formatting/names.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rules/unsafe_usage/src/lib.rs | Switch lint emission to emit_span_lint via a Diagnostic wrapper; doc/comment refresh. |
| rules/missing_type/src/lib.rs | Same migration to emit_span_lint; minor refactors and documentation updates. |
| rules/indexing_usage/src/lib.rs | Same migration to emit_span_lint; simplify message selection logic. |
| Cargo.toml | Removes rules/panic_usage from workspace members. |
| Cargo.lock | Dependency updates and removal of panic_usage crate entry. |
| .github/workflows/ci.yaml | YAML formatting/readability tweaks (named steps, branches formatting). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let Some(body_id): Option<BodyId> = context.enclosing_body else { | ||
| return; | ||
| }; |
There was a problem hiding this comment.
The pattern type annotation here (let Some(body_id): Option<BodyId> = ...) is redundant since context.enclosing_body already has a concrete type. Dropping the : Option<BodyId> makes the let-else binding easier to read without changing behavior.
| "rules/panic_usage", | ||
| "rules/indexing_usage", | ||
| ] | ||
| members = ["rules/missing_type", "rules/unsafe_usage", "rules/indexing_usage"] |
There was a problem hiding this comment.
The workspace member list drops rules/panic_usage, effectively removing the panic_usage Dylint rule from the repo. This is a functional change beyond a Dylint API migration and currently leaves docs inconsistent (the root README still documents security_panic_usage). If the rule is intended to stay, it should be migrated to the new API and kept in the workspace; if it’s intentionally removed, please also update/remove the corresponding documentation and any references to the lint/rule name.
No description provided.