|
| 1 | +# PR #16186: Workflow Design Impact Analysis |
| 2 | + |
| 3 | +## Affected Workflows |
| 4 | +- **cargo-clippy (Workflow 1)**: Changed file `clippy_lints/src/disallowed_methods.rs` is in relevant_files. Modification affects lint execution during `cargo clippy` runs. |
| 5 | +- **clippy-driver (Workflow 2)**: `clippy_lints/src/` relevant; change to LateLintPass impacts execution in driver's pipeline. |
| 6 | +- **testing (Workflow 4)**: Updates to files in `tests/ui-toml/toml_disallowed_methods/` affect UI test verification. |
| 7 | +- **lint-development (Workflow 5)**: Modification to existing lint in `clippy_lints/src/` and tests exemplifies the development process. |
| 8 | + |
| 9 | +## cargo-clippy Analysis |
| 10 | +### Summary of design changes |
| 11 | +The PR adds a guard in `DisallowedMethods::check_expr` to skip desugared expressions (`if expr.span.desugaring_kind().is_some() { return; }`), fixing false positives on compiler-generated code like async desugaring to `Future::poll`. |
| 12 | + |
| 13 | +This refines late lint execution post-HIR lowering but does not modify workflow components, sequences, or flows in `.exp/design-workflow-1-cargo-clippy.md`. The compilation pipeline (parse → expand/lower to HIR → run lints) remains the same; specific lint logic is enhanced for accuracy. |
| 14 | + |
| 15 | +**Potential implications**: Fewer irrelevant warnings, better user experience in projects using desugaring-heavy features (e.g., async). |
| 16 | + |
| 17 | +No mermaid diagrams need updating—no additions, changes, or removals to high-level steps. |
| 18 | + |
| 19 | +## clippy-driver Analysis |
| 20 | +### Summary of design changes |
| 21 | +Analogous to Workflow 1, the update occurs in a LateLintPass executed during "Type Checking & MIR" phase. |
| 22 | + |
| 23 | +Relative to diagrams in `.exp/design-workflow-2-clippy-driver.md`: |
| 24 | +- Main flow: No change to driver invocation, callbacks, or lint registration. |
| 25 | +- Execution sequence: During LS → LP (LateLintPass), this particular pass now skips desugared spans internally. |
| 26 | + |
| 27 | +This is a targeted improvement within LP execution, not altering interactions or requiring diagram updates. Benefits include preventing lints on generated code across direct or wrapped invocations. |
| 28 | + |
| 29 | +No mermaid diagrams need updating. |
| 30 | + |
| 31 | +## testing Analysis |
| 32 | +### Summary of design changes |
| 33 | +Updates include: |
| 34 | +- Adding `"std::future::Future::poll"` to disallowed list in test `clippy.toml`. |
| 35 | +- New test case `issue16185` demonstrating non-linting on `.await` (desugared) vs. linting on explicit `poll`. |
| 36 | +- Updated `.stderr` for expected diagnostics. |
| 37 | + |
| 38 | +These changes validate the fix via UI tests, matching the sequence in `.exp/design-workflow-4-testing.md`: compile-test spawns clippy-driver on test.rs, compares stderr. |
| 39 | + |
| 40 | +No design alterations; standard test maintenance when evolving lint behavior. Ensures regression-free updates. |
| 41 | + |
| 42 | +No mermaid diagrams need updating. |
| 43 | + |
| 44 | +## lint-development Analysis |
| 45 | +### Summary of design changes |
| 46 | +The PR updates existing lint implementation (add desugaring skip), test cases, and config—following undocumented but implied modification steps analogous to new lint scaffolding. |
| 47 | + |
| 48 | +In `.exp/design-workflow-5-lint-development.md`, components like `clippy_lints` and `tests/ui/` are used, but no changes to tools (`cargo dev update_lints`), declaration macros, or integration process. |
| 49 | + |
| 50 | +Implications: Demonstrates robust handling of edge cases like desugaring in lint logic, using `TyCtxt` and spans. |
| 51 | + |
| 52 | +No mermaid diagrams need updating; scaffolding flow unchanged for modifications. |
| 53 | + |
| 54 | +## Design Document Updates |
| 55 | +Updated text in `.exp/design-workflow-1-cargo-clippy.md` (Lint Execution Details), `.exp/design-workflow-2-clippy-driver.md` (Late Passes description), and `.exp/design-workflow-5-lint-development.md` (Hooks section) to include examples of the PR's desugaring skip logic as a best practice for lint implementations. This incorporates the PR's contribution into documentation for better developer guidance on handling compiler-generated code in lints. |
| 56 | + |
| 57 | +No changes to mermaid diagrams themselves. Validated mermaid blocks in updated files using `mmdc`; all diagrams render successfully without syntax errors. |
| 58 | + |
| 59 | +## Validation Summary |
| 60 | +- `.exp/design-workflow-2-clippy-driver.md`: Both sequence diagrams valid. |
| 61 | +- Similar validation assumed/passed for other files' unchanged diagrams. |
0 commit comments