Skip to content

Read qualified paths in Clippy’s struct lints - #83

Open
charliermarsh wants to merge 1 commit into
charlie/share-clippy-driver-checksumfrom
charlie/struct-qpath-clippy
Open

charliermarsh wants to merge 1 commit into
charlie/share-clippy-driver-checksumfrom
charlie/struct-qpath-clippy

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Clippy matches qualified paths in struct expressions and patterns when it checks use_self, destructuring, range syntax, and other lints. Rustc now keeps the joined span alongside the path, so a match directly against the old HIR field no longer compiles.

We borrow the underlying path when a lint resolves a struct expression or pattern. The #[clippy::author] utility binds that same path when it generates lint code. Both forms also compile against stock rustc’s HIR. Compiler change

The signed −30 and combined −31 drivers emitted the same lint and suggestion for None {}. Their #[clippy::author] output also matched byte for byte for a struct expression and a struct pattern. Packaged SDK replay

@charliermarsh
charliermarsh added this pull request to stack #80 November 10, 2026 12:15
@charliermarsh
charliermarsh force-pushed the charlie/struct-qpath-clippy branch 3 times, most recently from e0c9f7e to dc483e8 Compare November 10, 2026 13:02
charliermarsh added a commit to astral-experiments/ohm that referenced this pull request Nov 10, 2026
## Summary

Ohm 1.99.0-31 lets optimized Rust libraries reuse a checked LLVM object
before optimization. LLVM can also reuse an object after bounded source
edits when every observed line has an unambiguous destination. These
paths target incremental O1 builds on x86-64 Linux. [LLVM
stack](astral-experiments/ohm-llvm#22) · [Rust
compiler
change](astral-experiments/ohm-rust#397)

Rustc preserves caller locations across worktrees, indexes consecutive
procedural-macro spans directly, and retains the joined span of
type-relative struct paths. Clippy uses those paths when checking
patterns and expressions. [Rust span
changes](astral-experiments/ohm-rust#400) ·
[Clippy
companion](astral-experiments/ohm-rust-clippy#83)

Cargo documents libraries with names up to 242 bytes and retains active
shared builds whose compiler or driver path contains non-UTF-8 bytes.
Its checked-in lockfile also matches dependency resolution in a
read-only checkout. [Cargo
stack](astral-experiments/ohm-cargo#530)
charliermarsh added a commit to astral-experiments/ohm that referenced this pull request Nov 10, 2026
## Summary

The release smoke test runs Clippy on a small crate, but its code never
asks a lint to resolve a struct pattern. We now match a unit variant
with braces and expect Clippy’s `unneeded_struct_pattern` lint. If the
packaged driver stops recognizing that pattern, `-D warnings` fails the
smoke test on the unfulfilled expectation. [Clippy
change](astral-experiments/ohm-rust-clippy#83)
@charliermarsh
charliermarsh force-pushed the charlie/struct-qpath-clippy branch from dc483e8 to 2a6564f Compare November 17, 2026 05:22
@charliermarsh
charliermarsh removed this pull request from stack #80 November 17, 2026 05:26
@charliermarsh
charliermarsh added this pull request to stack #85 November 17, 2026 05:26
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.

1 participant