We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Tried to prove and verify the following with --experimental-ssa:
--experimental-ssa
struct Foo { bar: Bar } struct Bar { x: Field } impl Bar { fn mutate(&mut self) { self.x = 32; } } fn main() { let foo = &mut Foo { bar: Bar { x: 0 } }; foo.bar.mutate(); assert(foo.bar.x == 32); }
Expected the code to prove and verify with foo.bar.x now equal to 32.
foo.bar.x
Due to . automatically dereferencing, the call to mutate is equivalent to
.
mutate
mutate(&mut (*foo).bar);
which mutates a copy of foo.bar rather than the original. So foo.bar.x would still equal 0 after the call to mutate, thus failing the assert.
None
No response
No
The text was updated successfully, but these errors were encountered:
@jfecher what's the status of this issue?
Sorry, something went wrong.
@kevaundray still open
jfecher
Successfully merging a pull request may close this issue.
Aim
Tried to prove and verify the following with
--experimental-ssa
:Expected Behavior
Expected the code to prove and verify with
foo.bar.x
now equal to 32.Bug
Due to
.
automatically dereferencing, the call tomutate
is equivalent towhich mutates a copy of foo.bar rather than the original. So
foo.bar.x
would still equal 0 after the call to mutate, thus failing the assert.To Reproduce
Installation Method
None
Nargo Version
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered: