You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
The benchmarking v2 syntax allows any return type on benchmark function definitions. We should probably only be allowing () (blank return type) or Result<(), BenchmarkError> in scenarios where the programmer wants to use the ? operator somewhere in the benchmark function body.
After talking about this with @ggwpez we thought it would make sense to require a return type of Result<(), BenchmarkError> in scenarios where the programmer uses the ? operator within the function body, and also allow a blank () return type. Any other return types on the benchmark function definitions would trigger a compiler error. Doing things this way will make the benchmark function defintion feel more like a real function and will make people more aware that they can use ? in these contexts (and avoid the confusing situation where someone writes ? and it compiles even though what appears to be the enclosing function def does not have a Result or Option return type).