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

allow #[verifier(external_body)] again on consts #1323

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

utaal
Copy link
Collaborator

@utaal utaal commented Oct 29, 2024

Write test for regression introduced by bf90ae0 and reported by #1322, partial fix.

@tjhance can you take a look to see if you can spot why the test is failing (after I allowed Consts as items that can be external_body)? You've recently worked on this code, so you're probably the most familiar.

@tjhance
Copy link
Collaborator

tjhance commented Oct 29, 2024

This issue doesn't have to do with the external-refactor, i.e., I get this panic on 601e1e7 (commit before bf90ae0):

thread '<unnamed>' panicked at vir/src/poly.rs:405:66:
no entry found for key

(The key-not-found in question is VarIdent("%return", VirParam)). So I think we may have never supported this, or it was something else that broke it.

@utaal
Copy link
Collaborator Author

utaal commented Oct 29, 2024

Thanks for checking! And sorry for the incorrect blame for the regression.

@matthias-brun can you confirm that this used to work? If so, we can bisect to find the culprit, or otherwise work on a solution.

@matthias-brun
Copy link
Collaborator

Ah, it looks like combining external_body with a const ensures used to cause a panic but now generates the error.

My original example didn't have the ensures.

use vstd::prelude::verus; verus!{

#[verifier(external_body)]
const A: usize = unimplemented!();
}

This one works fine on Verus commit 2dbda4a but generates the error on current main.

@tjhance
Copy link
Collaborator

tjhance commented Oct 29, 2024

I'd suggest we go ahead and merge this then, and file an issue for the external_body/ensures combo.

@utaal utaal force-pushed the restore-external-body-const branch from 8fa4069 to f94e290 Compare October 29, 2024 17:21
@utaal utaal changed the title Fix #1322 [wip] allow #[verifier(external_body)] again on consts Oct 29, 2024
@utaal utaal marked this pull request as ready for review October 29, 2024 17:23
@utaal utaal merged commit 89b3e7a into main Oct 29, 2024
10 checks passed
@utaal utaal deleted the restore-external-body-const branch October 29, 2024 17:23
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.

3 participants