Closed eggyal closed 2 years ago
Let's merge this
@bors r+
:pushpin: Commit 994bc59222a1c8e74728757666df89d30bc44b35 has been approved by jackh726
It is now in the queue for this repository.
:hourglass: Testing commit 994bc59222a1c8e74728757666df89d30bc44b35 with merge b460e4b7bc453e56bfcc31c5bd639f4b70de82c6...
:sunny: Test successful - checks-actions Approved by: jackh726 Pushing b460e4b7bc453e56bfcc31c5bd639f4b70de82c6 to master...
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