rust-lang / rust-lang/rust-clippy
`default_trait_access` autofix not working
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
Description
Hi
I find clippy very very useful and one lint I get a lot is default_trait_access. For some reason, it doesn't autofix when this is available even though the fix is suggested.
It's implemented here, but there's a comment that references a TODO that doesn't seem to exist:
https://github.com/rust-lang/rust-clippy/blob/e52501913b75235e3d41422566a2d05d6f00b699/clippy_lints/src/default.rs#L97-L105
This was authored by @flip1995 (perhaps you can help)?
There's also this suspicious file with errors tests/ui/default_trait_access.rs and fixes tests/ui/default_trait_access.fixed, so maybe my settings aren't correct.
Please, let me know and I'd be happy to implement this once the mysterious TODO comment is resolved.
Version
rustc 1.97.0 (2d8144b78 2026-07-07)
binary: rustc
commit-hash: 2d8144b7880597b6e6d3dfd63a9a9efae3f533d3
commit-date: 2026-07-07
host: x86_64-unknown-linux-gnu
release: 1.97.0
LLVM version: 22.1.6
Additional Labels
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in clippy_lints/src/default.rs around the default_trait_access implementation and inspect the TODO comment. Compare tests/ui/default_trait_access.rs with tests/ui/default_trait_access.fixed, then run the relevant UI test to reproduce the missing autofix. Done means the suggested default_trait_access change is applied correctly and the regression coverage passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100