librustc: Change fold to use traits instead of `@fn`.

r? @brson