diff options
| author | bors <bors@rust-lang.org> | 2021-02-21 15:22:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-02-21 15:22:35 +0000 |
| commit | d2ddf9c79602e54e535649fa13ffa41c25c3508a (patch) | |
| tree | 9d83c68627613ddf846055a612651c0fda394d06 /src/test/codegen/src-hash-algorithm | |
| parent | 67087a1b4ee06ce42fd8abe5825f9af96a41e83d (diff) | |
| parent | 9ad6e263c9eec118a37cdbd5e182afaaad42840a (diff) | |
| download | rust-d2ddf9c79602e54e535649fa13ffa41c25c3508a.tar.gz rust-d2ddf9c79602e54e535649fa13ffa41c25c3508a.zip | |
Auto merge of #6754 - camsteffen:spanlesseq-res, r=flip1995
Teach SpanlessEq binding IDs
changelog: Fix collapsible_match false positive
Fixes #6740
This PR changes the way `SpanlessEq` determines whether two local variables are the same. Instead of checking that the names match, it checks that the `HirId`s match. If local bindings are declared within the expressions that are being compared, `SpanlessEq` will remember bindings that correspond to each other in a `FxHashMap<HirId, HirId>`. This makes `SpanlessEq` more flexible while also fixing false positives.
Example: `{ let x = 1; x + 2 }` is equal to `{ let y = 1; y + 2 }`.
CC `@xFrednet` I think this will resolve some concerns in #6463
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions
