about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-02-17 23:00:55 +0100
committerGitHub <noreply@github.com>2022-02-17 23:00:55 +0100
commit98c54c8cad638e703b631a5ff64630e5e55eb5dc (patch)
treede391393e0e780ac495475ff69edd18d629a0638 /src/test/codegen/src-hash-algorithm
parent67331708e88609736e26706c4d5358f19c7e7781 (diff)
parent94f08492af3e2acdd32cbc24607f1d1fb17192f7 (diff)
downloadrust-98c54c8cad638e703b631a5ff64630e5e55eb5dc.tar.gz
rust-98c54c8cad638e703b631a5ff64630e5e55eb5dc.zip
Rollup merge of #93758 - nnethercote:improve-folding-comments, r=BoxyUwU
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.

r? `@BoxyUwU`
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions