Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognise that namespace can't fail #490

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Conversation

matthiasgoergens
Copy link
Collaborator

@matthiasgoergens matthiasgoergens commented Oct 28, 2024

At least ConstraintSystem::namespace won't fail on its own. But it might fail, if the circus construction function (or so) you are passing to fails.

The new type reflects that.

Extracted from #466 and addressing https://github.com/scroll-tech/ceno/pull/455/files#r1818907561

This will lead to a lot of clean up down the line, but I want to keep this PR small.

At least `ConstraintSystem::namespace` won't fail on its own.  But it
might fail, if the circus construction function (or so) you are passing
to fails.

The new type reflects that.
cb: impl FnOnce(&mut ConstraintSystem<E>) -> Result<T, ZKVMError>,
) -> Result<T, ZKVMError> {
cb: impl FnOnce(&mut ConstraintSystem<E>) -> T,
) -> T {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically, this works exactly as before, when the 'new' T happens to be a Result<_, ZKVMError>.

@matthiasgoergens matthiasgoergens merged commit cc41908 into master Oct 29, 2024
6 checks passed
@matthiasgoergens matthiasgoergens deleted the matthias/name-space branch October 29, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants