Reject proof harnesses with arguments#2132
Merged
celinval merged 5 commits intomodel-checking:mainfrom Jan 19, 2023
Merged
Conversation
- Change `#[kani::proof]` expansion so it doesn't include `#[no_mangle]` but includes `[allow(dead_code)]`. Fixes model-checking#661 and fixes model-checking#689. - Add a check for harnesses with arguments and merge the checks into one function. Fixes model-checking#1919
tedinski
approved these changes
Jan 17, 2023
Contributor
|
One other thing: Can we change the PR title? Want to ensure that whoever write the release notes will notice that this is a possible "breaking" change. Maybe:
|
zhassan-aws
reviewed
Jan 17, 2023
| let (proof_attributes, _) = partition_kanitool_attributes(all_attributes); | ||
| /// Check that if an item is tagged with a proof_attribute, it is a valid harness. | ||
| fn check_proof_attribute(&self, def_id: DefId, proof_attributes: Vec<&Attribute>) { | ||
| if !proof_attributes.is_empty() { |
Contributor
There was a problem hiding this comment.
This condition is also checked by the callers. Should we remove it and turn it into an assert?
Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
I had forgotten to add the tests before. Sorry!
zhassan-aws
approved these changes
Jan 18, 2023
#[kani::proof] handling
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.
Description of changes:
Change
#[kani::proof]expansion so it doesn't include#[no_mangle]but includes[allow(dead_code)]. (RMC should use fully qualified name for harness selection and it should not rely onno_mangleattribute #661 and Introduce rmctool attribute validation #689).Add a check for harnesses with arguments and merge the checks into one function (Inconsistent behavior when functions with parameters are used as harnesses #1919).
Resolved issues:
Fixes #661
Fixes #689
Fixes #1919
Related RFC:
Call-outs:
Testing:
How is this change tested? New test
Is this a refactor change?
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.