Repository navigation
Preserve specialization default in function contract attributes - #5153
Open
Tiramisu-Cake wants to merge 1 commit into
Open
Tiramisu-Cake wants to merge 1 commit into
Tiramisu-Cake wants to merge 1 commit into
Conversation
Parse annotated functions directly as syn::ImplItemFn and preserve default through initial and stacked contract expansions. Keep contracts attached to their annotated implementation. Cover specialization contract clauses, both clause orders with verified stubs, generic methods, old expressions, and expected contract violations. Disable contract assertions in the invalid-caller regression so its expected precondition failure depends on the verified stub. Resolves model-checking#5116
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#[kani::requires],#[kani::ensures], and#[kani::modifies]fail to parse a specializationdefault fnbecausesyn::ItemFndoes not accept thedefaultkeyword. Parse the function withsyn::ImplItemFnand preservedefaultthrough the initial and subsequent macro expansions. An override still needs its own contract to be aproof_for_contracttarget.The regression tests reproduce the blanket
SmallSortimpl from #5116 and cover individual and stacked clauses,old, and generic methods withproof_for_contractandstub_verified. The expected-output tests check contract violations and the diagnostic for an override without a contract.Testing
syn::ImplItemFn) also passed the nine new cases and ten existing tests in a targeted compiletest run on Linux with the patch applied tof046b70644.Resolves #5116
Disclosure: this change and description were prepared with AI assistance.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.