Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve comments about type folding/visiting. #93758

Merged
merged 1 commit into from
Feb 18, 2022

Commits on Feb 17, 2022

  1. 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.
    nnethercote committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    94f0849 View commit details
    Browse the repository at this point in the history