Stream: git-cranelift

Topic: cranelift / Issue #544 VerifierStepResult is confusing


view this post on Zulip GitHub (Feb 28 2020 at 23:25):

alexcrichton transferred Issue #544:

The verifier functions have an API that could probably be simplified. Functions which return VerifierStepResult must by convention also take an out-param VerifierErrors that will contain non-fatal errors.

Moreover, the T in VerifierStepResult<T> seems to always be set to (), so it's unused.

It seems the out param is redundant with the error that's present in the Result hidden VerifierStepResult. I think slightly modifying the interface of VerifierStepResult would avoid this out param:

Then we wouldn't need the errors outparam anymore, which looks cleaner and "more Rusty". It might mean that a few users of the fatal! etc macros would need to have their own errors variable, but that seems OK.

Thoughts?


Last updated: Dec 23 2024 at 14:03 UTC