Closed
Description
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.