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

Upgrade toolchain to nightly-2024-04-15 #3144

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

celinval
Copy link
Contributor

@celinval celinval commented Apr 16, 2024

Related changes:

Resolves #3130, #3142

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

  - rust-lang/rust#120131:
    Add support to `Pat` pattern type
  - rust-lang/rust#122935:
    Rename CastKind::PointerWithExposedProvenance
  - rust-lang/rust#123097:
    Adapt to changes to local_def_path_hash_to_def_id
The return value is in fact an enumeration, not an integer
@celinval celinval requested a review from a team as a code owner April 16, 2024 04:39
@github-actions github-actions bot added the Z-BenchCI Tag a PR to run benchmark CI label Apr 16, 2024
@celinval
Copy link
Contributor Author

Note to self: Add a test to Pat to ensure we capture invalid valid generated during a transmute.

Copy link
Member

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

For my own learning: the changes in 1abfa0f ("Fix BinOp implementation") seem much bigger than what I initially had for the Cmp operator. Could you please explain a bit?

cprover_bindings/src/goto_program/expr.rs Show resolved Hide resolved
@celinval
Copy link
Contributor Author

For my own learning: the changes in 1abfa0f ("Fix BinOp implementation") seem much bigger than what I initially had for the Cmp operator. Could you please explain a bit?

I added a comment to the code, which explains why this is slightly more complex. The result of a comparison is not an integer, but an enumeration. So Kani would crash with the previous implementation when it would try to assign the comparison expression due to mismatched type.

Part of the logic I added is to guarantee that the transmute is safe, but it is not really necessary. But I check that the enumeration layout matches what we expect, which is an i8 that goes from -1 to 1.

@celinval celinval linked an issue Apr 16, 2024 that may be closed by this pull request
@celinval
Copy link
Contributor Author

I'm merging this PR despite the issue with the benchmark job, since it is blocked due to a bug in the benchcomp tool itself. It is failing to generate the comparison tables since the base commit is currently broken due to #3138

@celinval celinval merged commit b9bd7a8 into model-checking:main Apr 16, 2024
22 of 23 checks passed
celinval added a commit to celinval/kani-dev that referenced this pull request Apr 17, 2024
Related changes:
  - rust-lang/rust#118310:
    Add `Ord::cmp` for primitives as a `BinOp` in MIR
  - rust-lang/rust#120131:
    Add support to `Pat` pattern type
  - rust-lang/rust#122935:
    Rename CastKind::PointerWithExposedProvenance
  - rust-lang/rust#123097:
    Adapt to changes to local_def_path_hash_to_def_id

Resolves model-checking#3130, model-checking#3142
zpzigi754 pushed a commit to zpzigi754/kani that referenced this pull request May 8, 2024
Related changes:
  - rust-lang/rust#118310:
    Add `Ord::cmp` for primitives as a `BinOp` in MIR
  - rust-lang/rust#120131:
    Add support to `Pat` pattern type
  - rust-lang/rust#122935:
    Rename CastKind::PointerWithExposedProvenance
  - rust-lang/rust#123097:
    Adapt to changes to local_def_path_hash_to_def_id

Resolves model-checking#3130, model-checking#3142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-BenchCI Tag a PR to run benchmark CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Newest proc_macro2 version does not work with kani-0.49.0 Toolchain upgrade to nightly-2024-04-03 failed
2 participants