Skip to content

Refactor Fold to take by value #642

Closed
@detrumi

Description

@detrumi

Currently, the Folder trait takes folded values by reference. As part of the shared type library plan, the fold traits should take their folded values by value, to match the TypeFolder trait in rustc.

For example, this

fn fold_ty(&mut self, ty: &Ty<I>, outer_binder: DebruijnIndex) -> Fallible<Ty<TI>>

should be changed to this:

fn fold_ty(&mut self, ty: Ty<I>, outer_binder: DebruijnIndex) -> Fallible<Ty<TI>>

Same thing with the other folding functions.
Lastly, code that calls folding functions should pass the values by value, instead of by reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueA good issue to start working on Chalk with

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions