Skip to content

feat: migrated dylint api to latest version#3

Open
maximedrn wants to merge 3 commits intomasterfrom
dev
Open

feat: migrated dylint api to latest version#3
maximedrn wants to merge 3 commits intomasterfrom
dev

Conversation

@maximedrn
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 25, 2026 09:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_lint by introducing a LintMsg wrapper implementing rustc_errors::Diagnostic.
  • Remove the rules/panic_usage rule crate (source + UI tests + docs/config) and drop it from the workspace.
  • Refresh Cargo.lock and tidy .github/workflows/ci.yaml step 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.

Comment on lines 89 to 91
let Some(body_id): Option<BodyId> = context.enclosing_body else {
return;
};
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
"rules/panic_usage",
"rules/indexing_usage",
]
members = ["rules/missing_type", "rules/unsafe_usage", "rules/indexing_usage"]
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
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.

2 participants