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

Function Contracts: Closure Type Inference #3307

Merged
merged 8 commits into from
Jul 1, 2024

Conversation

pi314mm
Copy link
Contributor

@pi314mm pi314mm commented Jun 28, 2024

The rust type inference for closures doesn't work in the particular use case we are using it for ensures clauses. By creating a helper function, we change the path the rust type inference takes and lets the type of the closure be identified properly. This means type annotations are no longer required within ensures clauses.

Resolves #3304

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@pi314mm pi314mm added this to the Function Contracts milestone Jun 28, 2024
@pi314mm pi314mm self-assigned this Jun 28, 2024
@github-actions github-actions bot added the Z-BenchCI Tag a PR to run benchmark CI label Jun 28, 2024
@pi314mm pi314mm marked this pull request as ready for review June 28, 2024 18:55
@pi314mm pi314mm requested a review from a team as a code owner June 28, 2024 18:55
@pi314mm pi314mm added the [C] Feature / Enhancement A new feature request or enhancement to an existing feature. label Jun 28, 2024
library/kani/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks

@pi314mm pi314mm enabled auto-merge (squash) July 1, 2024 16:13
@pi314mm pi314mm merged commit 6f0c0b5 into model-checking:main Jul 1, 2024
24 of 25 checks passed
@pi314mm pi314mm deleted the annotate_closure branch July 18, 2024 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature. Z-BenchCI Tag a PR to run benchmark CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UX Improvement: Ensures clause requires type annotation
2 participants