-
Notifications
You must be signed in to change notification settings - Fork 58
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
error: expression has mode proof, expected mode exec
when using pervasive::map
#167
Comments
Thanks for your interest in the project! The issue is that Eventually, we should have an |
Hi @parno , thanks for your reply! I tried to find some workaround and interestingly verus does not report any error if I change myfun to the following:
Is this a valid workaround that allows us to return different values according to |
Good catch -- that's a bug. This should fix it: ef62f0d |
Should we also make it an error to use |
Ultimately, the error for something like |
I didn't think about the generics, but I think error/warning in this situation will always be helpful and result in a more relevant span (and help new users in situations like this one). I've frequently found it surprising when these errors wouldn't caught and I would end up getting an error while trying to call a function that had a parameter accidentally marked as For the generics, I think we could catch it when it's instantiated, like when we instantiate |
I've made a discussion to track the possible warning feature, #170 I'm going to close this as resolved otherwise; feel free to reopen if you have follow-up questions. |
Hi Verus developers,
Thanks for building verus and I am currently using it to verify some programs I wrote before. But I encountered some confusing errors and need some help from you.
I was running verus (
./tools/rust-verify.sh rust_verify/example/myexample.rs
) on the following program:and verus reports the error
If I remove the usage of Map, the error will disappear. I am confused about why this error can happen as I have annotated every function and every enum with
exec
as shown in the code, and why it is related to the pervasive::map. I have read this doc: https://github.com/secure-foundations/verus/blob/main/source/docs/design/modes.md but still do not know what is the root cause of the error. Could you please let me know what is the best way to address this error?Thank you
The text was updated successfully, but these errors were encountered: