rust-clippy/clippy_lints
bors 7217c0f3ac Auto merge of #11628 - koka831:fix/11625, r=blyxyas
Improve `redundant_locals` help message

Fixes #11625

AFAIK, `span_lint_and_help` points the beginning of spans when we pass multiple spans to the second argument, so This PR I also modified its help span and its message.

lint result of the given example in the issue will be:

```console
error: redundant redefinition of a binding `apple`
 --> src/main.rs:5:5
  |
5 |     let apple = apple;
  |     ^^^^^^^^^^^^^^^^^^
  |
help: `apple` is initially defined here
 --> src/main.rs:4:9
  |
4 |     let apple = 42;
  |         ^^^^^
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals
```

I hope that this change might help reduce user confusion, but I'd appreciate alternative suggestions:)

changelog: [`redundant_locals`]: Now points at the rebinding of the variable
2023-10-06 15:06:00 +00:00
..
src Auto merge of #11628 - koka831:fix/11625, r=blyxyas 2023-10-06 15:06:00 +00:00
Cargo.toml Test that each config value exists in a test clippy.toml 2023-09-25 12:38:23 +00:00
README.md

This crate contains Clippy lints. For the main crate, check GitHub.