about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-02-08 11:46:53 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2022-02-17 23:15:40 +1100
commit94f08492af3e2acdd32cbc24607f1d1fb17192f7 (patch)
tree72924dc73022df21ccea26ab7f0861dadf8f0c70 /src/test/codegen/src-hash-algorithm
parentbfb2856f271fcb647b3cad1b88b29ec97bbab2a3 (diff)
downloadrust-94f08492af3e2acdd32cbc24607f1d1fb17192f7.tar.gz
rust-94f08492af3e2acdd32cbc24607f1d1fb17192f7.zip
Improve comments about type folding/visiting.
I have found this code confusing for years. I've always roughly
understood it, but never exactly. I just made my fourth(?) attempt and
finally cracked it.

This commit improves the comments. In particular, it explicitly
describes how you can't do a custom fold/visit of any type; there are
actually a handful of "types of interest" (e.g. `Ty`, `Predicate`,
`Region`, `Const`) that can be custom folded/visted, and all other types
just get a generic traversal. I think this was the part that eluded me
on all my prior attempts at understanding.

The commit also updates comments to account for some newer changes such
as the fallible/infallible folding distinction, does some minor
reorderings, and moves one `impl` to a better place.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions