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-2022-09-13 #1737

Merged
merged 4 commits into from
Oct 3, 2022

Conversation

celinval
Copy link
Contributor

@celinval celinval commented Sep 30, 2022

Description of changes:

Relevant changes to rustc:

Resolved issues:

Fixes #1615

Related RFC:

Optional #ISSUE-NUMBER.

Call-outs:

I created a special case for the niche optimization to keep using struct instead of union for cases where the enumeration only has one non-ZST variant. Without this, the kani test suite takes more than 30min to finish. My guess is that it impacts a lot of Option<> and common enums out there.

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.

Fixes model-checking#1615

Relevant changes to rustc:
  - rust-lang/rust#101483: Change to intrinsics.
  - rust-lang/rust#94075: Change to niche opt.
  - rust-lang/rust#101101: Method rename.

Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
@celinval celinval requested a review from a team as a code owner September 30, 2022 22:07
@@ -544,6 +544,13 @@ impl Expr {
Self::double_constant(c)
}

/// `if (c) { t } else { e }`
pub fn if_then_else_expr(c: Expr, t: Expr, e: Expr) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this the same as the ternary method?

pub fn ternary(self, t: Expr, e: Expr) -> Expr {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call! Let me replace that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Mea culpa, I wasn't able to find it.

@@ -1012,6 +1004,26 @@ impl<'tcx> GotocCtx<'tcx> {
Stmt::block(vec![src_align_check, dst_align_check, overflow_check, copy_expr], loc)
}

// In some contexts (e.g., compilation-time evaluation),
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice documentation!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kudos to @adpaco-aws. :)

ref dst,
ref count,
}) => {
mir::StatementKind::Intrinsic(box NonDivergingIntrinsic::CopyNonOverlapping(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the mir:: prefix needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably not. Let me remove that.

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.

Thanks!

@celinval celinval merged commit 07092de into model-checking:main Oct 3, 2022
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.

Update rust toolchain version for Kani 0.11
3 participants