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

Enforce unstable APIs can only be used if the related feature is enabled #2386

Merged
merged 9 commits into from
May 2, 2023

Conversation

celinval
Copy link
Contributor

@celinval celinval commented Apr 18, 2023

Description of changes:

This PR adds the new opt-in option for users to enable unstable features (via -Z option or unstable table in Cargo.toml). This PR also adds logic to parse and verify APIs tagged with unstable.

Resolved issues:

Fixes #2357

Related RFC:

#2279

Call-outs:

  1. We still need to finish migrating all unstable features to the new model and deprecate the old ones.
  2. This PR turned out a big big. I can break it down if needed.

Testing:

  • How is this change tested? New tests

  • Is this a refactor change? No

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

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

@celinval celinval requested a review from a team as a code owner April 18, 2023 02:59
kani-compiler/src/kani_middle/attributes.rs Show resolved Hide resolved
kani-compiler/src/kani_middle/attributes.rs Outdated Show resolved Hide resolved
kani-compiler/src/kani_middle/attributes.rs Outdated Show resolved Hide resolved
kani-compiler/src/kani_middle/attributes.rs Outdated Show resolved Hide resolved
kani-compiler/src/kani_middle/attributes.rs Show resolved Hide resolved
kani-compiler/src/kani_middle/mod.rs Show resolved Hide resolved
kani-driver/src/args.rs Outdated Show resolved Hide resolved
kani-driver/src/args.rs Outdated Show resolved Hide resolved
kani-driver/src/args_toml.rs Show resolved Hide resolved
kani-compiler/src/kani_middle/mod.rs Show resolved Hide resolved
kani-compiler/src/kani_middle/attributes.rs Outdated Show resolved Hide resolved
kani-compiler/src/kani_middle/attributes.rs Outdated Show resolved Hide resolved
kani-driver/src/args.rs Outdated Show resolved Hide resolved
kani-driver/src/args.rs Outdated Show resolved Hide resolved
Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
Copy link
Contributor

@zhassan-aws zhassan-aws left a comment

Choose a reason for hiding this comment

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

LGTM. Adding a debug assert when the unstable annotation is not parseable would be nice, but not necessary in this PR.

kani-driver/src/args.rs Show resolved Hide resolved
@celinval
Copy link
Contributor Author

LGTM. Adding a debug assert when the unstable annotation is not parseable would be nice, but not necessary in this PR.

I just added in the last revision. :)

 - Break down check attribute function
 - Improve comment
 - Add debug_assert for invalid unstable attribute
 - Make all fields required
Copy link
Contributor

@adpaco-aws adpaco-aws left a comment

Choose a reason for hiding this comment

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

Thanks, @celinval !

kani-compiler/src/kani_middle/attributes.rs Outdated Show resolved Hide resolved
kani-compiler/src/kani_middle/attributes.rs Outdated Show resolved Hide resolved
kani-compiler/src/kani_middle/attributes.rs Outdated Show resolved Hide resolved
celinval and others added 2 commits April 27, 2023 11:51
Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
@celinval celinval enabled auto-merge (squash) April 27, 2023 18:53
@celinval celinval merged commit f61e34f into model-checking:main May 2, 2023
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.

Add unstable attribute to tag experimental APIs
3 participants