about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-02-07 08:40:41 +0000
committerbors <bors@rust-lang.org>2021-02-07 08:40:41 +0000
commitd51db24132fedaa5a3a0d8f97be27a0013123ce6 (patch)
tree62275fd8caede0bea5fb0bed4e114e7d5b0d0536 /src/test/codegen/src-hash-algorithm
parentb36d1a47274fb865deff3e7ade36a4c0e65c2d77 (diff)
parent56f7fbb4ae67041fc1d2474da7fe52f5a2fd25a8 (diff)
downloadrust-d51db24132fedaa5a3a0d8f97be27a0013123ce6.tar.gz
rust-d51db24132fedaa5a3a0d8f97be27a0013123ce6.zip
Auto merge of #6660 - camsteffen:path-to-local, r=llogiq
Cleanup path-to-local checks

changelog: none

It seemed like too much ceremony going on to check if an expression matches a variable. So I created two util functions `path_to_local(Expr) -> Option<HirId>` and `path_to_local_id(Expr, HirId) -> bool` to make this easier, and used them wherever applicable.

I changed logic in a few places to use `HirId` instead of `Symbol` where it was easy to do so. I believe this is more correct and may even fix some bugs.

I also removed some calls to `qpath_res`. This is not needed if you are only looking for a `Res::Local`.

As a note, I wanted to name the util functions in a way that encourages understanding of the HIR.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions