diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-02-08 11:46:53 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-02-17 23:15:40 +1100 |
| commit | 94f08492af3e2acdd32cbc24607f1d1fb17192f7 (patch) | |
| tree | 72924dc73022df21ccea26ab7f0861dadf8f0c70 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs | |
| parent | bfb2856f271fcb647b3cad1b88b29ec97bbab2a3 (diff) | |
| download | rust-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/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions
