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

Fix: Tail-recursion for result copy types in the Dafny-to-Rust backend. #5930

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

MikaelMayer
Copy link
Member

Description

Fixes #5923 completely, irrespective of the type of output variables.
The previous fix was only not redeclaring output variables when they were wrapped with MaybePlacebo, which is reserved for output variables that don't have a trivial initialization.
This fixes #5923 entirely by just ensuring we don't place output variables as part of the environment of recursive methods, since the TailRecursive(...) body already declares them

How has this been tested?

A new test added to rust/newtypes.dfy

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@MikaelMayer MikaelMayer changed the title Fixed Fix: Tail-recursion for result copy types in the Dafny-to-Rust backend. Nov 22, 2024
@MikaelMayer MikaelMayer enabled auto-merge (squash) November 22, 2024 20:48
@MikaelMayer MikaelMayer merged commit 48c876f into master Nov 25, 2024
22 checks passed
@MikaelMayer MikaelMayer deleted the fix-5923-better branch November 25, 2024 15:17
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.

Bad Rust code generated for recursive predicate
2 participants