Open
Description
Description
If the unnecessary_wraps
lint triggers, it highlights the entire function (in Rust Analyzer + VS Code at least).
I find this quite annoying: When I'm implementing a new function it can take a bit until I get to the part that can actually fail and return an error. Adding yellow squiggles to the entire function is quite distracting and also obscures other potential warnings:

Proposal:
- Reduce amount of code highlighted. I'm not sure how exactly that works, but maybe the primary span could point only at the result type or the function signature>
- At least inhibit the lint in the presence of
todo!()
Version
rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: aarch64-apple-darwin
release: 1.86.0
LLVM version: 19.1.7
Additional Labels
No response