chalk
chalk copied to clipboard
Split fallible infallible folding
For folding operations that cannot fail, the existing fallible folding trait is a little unergonomic. This PR introduces an infallible folder trait that can be used as a more ergonomic alternative in such cases, reflecting the status quo in rustc.
Infallible folders must however also implement the fallible trait (it's a supertrait of the infallible one), but such implementation should merely delegate to the infallible trait. Coherence rules unfortunately do not permit this to be provided by blanket implementation, however delegating implementations can be simply derived on infallible folders via the chalk_derive::FallibleTypeFolder
macro.
r? @jackh726