-
Notifications
You must be signed in to change notification settings - Fork 97
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
Conversation
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 <[email protected]>
@@ -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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice documentation!
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description of changes:
Relevant changes to rustc:
<*const T>::guaranteed_*
methods now return an option for the unknown case rust-lang/rust#101483: Change to intrinsics.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 ofunion
for cases where the enumeration only has one non-ZST variant. Without this, thekani
test suite takes more than 30min to finish. My guess is that it impacts a lot ofOption<>
and common enums out there.Testing:
How is this change tested? New tests
Is this a refactor change? No
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.