cfallin labeled issue #1056:
The verifier functions have an API that could probably be simplified. Functions which return
VerifierStepResultmust by convention also take an out-paramVerifierErrorsthat will contain non-fatal errors.Moreover, the
TinVerifierStepResult<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
ResulthiddenVerifierStepResult. I think slightly modifying the interface ofVerifierStepResultwould avoid this out param:
- let the
Oktype beVerifierErrors, in case we only have non-fatal errors (they could be called "warnings").- let the
Errtype stay the same (VerifierErrorstoo), and contain non-fatal and fatal errors, if there was at least one fatal error.Then we wouldn't need the
errorsoutparam anymore, which looks cleaner and "more Rusty". It might mean that a few users of thefatal!etc macros would need to have their ownerrorsvariable, but that seems OK.Thoughts?
cfallin labeled issue #1056:
The verifier functions have an API that could probably be simplified. Functions which return
VerifierStepResultmust by convention also take an out-paramVerifierErrorsthat will contain non-fatal errors.Moreover, the
TinVerifierStepResult<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
ResulthiddenVerifierStepResult. I think slightly modifying the interface ofVerifierStepResultwould avoid this out param:
- let the
Oktype beVerifierErrors, in case we only have non-fatal errors (they could be called "warnings").- let the
Errtype stay the same (VerifierErrorstoo), and contain non-fatal and fatal errors, if there was at least one fatal error.Then we wouldn't need the
errorsoutparam anymore, which looks cleaner and "more Rusty". It might mean that a few users of thefatal!etc macros would need to have their ownerrorsvariable, but that seems OK.Thoughts?
aidenfoxivey commented on issue #1056:
@cfallin This issue seems finished - could it be a candidate for being closed?
cfallin commented on issue #1056:
I don't think the core issue is actually resolved at all; and in the linked PR it mentions that it resolved a subpart of the problem only. This could still be a good starter-issue for someone wanting to do some cleanups.
aidenfoxivey commented on issue #1056:
I don't think the core issue is actually resolved at all; and in the linked PR it mentions that it resolved a subpart of the problem only. This could still be a good starter-issue for someone wanting to do some cleanups.
Ah neat, I see. I'll give it a read. :)
bahbah94 commented on issue #1056:
Hi, I would like to contribute to this.
Where exactly does this originate, i see that theTparam has been removed from the src/verifier/mod.rs
it seems i need to modify the type of VerifierResult, if this is the correct approach, are there tests suits to run to check correctness
bahbah94 commented on issue #1056:
If im not wrong
#[inline] pub fn as_result(&self) -> VerifierStepResult { if self.is_empty() { Ok(()) } else { Err(()) } }
the core problem lies here, where its returningOk(())and respectivelyErr(()). ---- > perhaps we should we returnOK(self)/Err(self)
fitzgen closed issue #1056:
The verifier functions have an API that could probably be simplified. Functions which return
VerifierStepResultmust by convention also take an out-paramVerifierErrorsthat will contain non-fatal errors.Moreover, the
TinVerifierStepResult<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
ResulthiddenVerifierStepResult. I think slightly modifying the interface ofVerifierStepResultwould avoid this out param:
- let the
Oktype beVerifierErrors, in case we only have non-fatal errors (they could be called "warnings").- let the
Errtype stay the same (VerifierErrorstoo), and contain non-fatal and fatal errors, if there was at least one fatal error.Then we wouldn't need the
errorsoutparam anymore, which looks cleaner and "more Rusty". It might mean that a few users of thefatal!etc macros would need to have their ownerrorsvariable, but that seems OK.Thoughts?
fitzgen commented on issue #1056:
Hey @bahbah94, this issue is pretty old and I don't think there's too much we need to do here actually. The verifier code has aged pretty well and been extended as necessary without problems, so I don't think it is worth spending time on this one.
If you are still looking for something Cranelift-y to do, I'd suggest #11971. Thanks!
bahbah94 commented on issue #1056:
@fitzgen Thanks for the reply. I'll have a look at #11971.
Last updated: Dec 06 2025 at 06:05 UTC