-
Notifications
You must be signed in to change notification settings - Fork 92
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
Update rust toolchain version #750
Conversation
Rvalue::NullaryOp(NullOp::Box, t) => { | ||
let t = self.monomorphize(*t); | ||
let layout = self.layout_of(t); | ||
let size = layout.size.bytes_usize(); | ||
let box_ty = self.tcx.mk_box(t); | ||
let box_ty = self.codegen_ty(box_ty); | ||
let cbmc_t = self.codegen_ty(t); | ||
let box_contents = BuiltinFn::Malloc | ||
.call(vec![Expr::int_constant(size, Type::size_t())], Location::none()) | ||
.cast_to(cbmc_t.to_pointer()); | ||
self.box_value(box_contents, box_ty) | ||
} |
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.
Why this change?
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.
This NullOp::Box had deprecated and replaced by ShallowInitBox. So they finally removed it.
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.
} | ||
/// A pointer to the mir type should be a vtable fat pointer. | ||
pub fn use_vtable_fat_pointer(&self, mir_type: Ty<'tcx>) -> bool { | ||
let metadata = mir_type.ptr_metadata_ty(self.tcx); | ||
let metadata = mir_type.ptr_metadata_ty(self.tcx, |ty| ty); |
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.
What if we made a function
fn normalize_type(ty: Ty<'tcx>) -> Ty<'tcx> {
ty
}
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.
Approved modulo discussion
Add a TODO and a link to the issue.
In order to make it easier to read and implement in the future.
This exact line where the assertion is may change whenever we update the rust toolchain, which makes this test unreliable. We still ensure that the assertion fails. Note that this may still fail if the message or the check gets updated, but this shouldn't happen frequently.
2c18120
to
9d4a26d
Compare
Thanks. I added the placeholder function as suggested. |
Fixes model-checking#747. * Update typ.rs. Add a placeholder for type normalization function to make it easier to read and implement in the future. * Remove the LOC of expected failure on std function. This exact line where the assertion is may change whenever we update the rust toolchain, which makes this test unreliable. We still ensure that the assertion fails. Note that this may still fail if the message or the check gets updated, but this shouldn't happen frequently.
Fixes model-checking#747. * Update typ.rs. Add a placeholder for type normalization function to make it easier to read and implement in the future. * Remove the LOC of expected failure on std function. This exact line where the assertion is may change whenever we update the rust toolchain, which makes this test unreliable. We still ensure that the assertion fails. Note that this may still fail if the message or the check gets updated, but this shouldn't happen frequently.
Fixes model-checking#747. * Update typ.rs. Add a placeholder for type normalization function to make it easier to read and implement in the future. * Remove the LOC of expected failure on std function. This exact line where the assertion is may change whenever we update the rust toolchain, which makes this test unreliable. We still ensure that the assertion fails. Note that this may still fail if the message or the check gets updated, but this shouldn't happen frequently.
Fixes #747. * Update typ.rs. Add a placeholder for type normalization function to make it easier to read and implement in the future. * Remove the LOC of expected failure on std function. This exact line where the assertion is may change whenever we update the rust toolchain, which makes this test unreliable. We still ensure that the assertion fails. Note that this may still fail if the message or the check gets updated, but this shouldn't happen frequently.
Description of changes:
Update toolchain version to the latest nightly version.
Resolved issues:
Resolves #747
Call-outs:
There has been a fixed that was pushed to rustc where they now normalize the struct-tail type when satisfying a Pointee obligation. I have not applied the fix yet, and this change keeps the same behavior for rmc. I wasn't able to reproduce the issue posted in the related PR yet. rust-lang/rust#92248
Testing:
How is this change tested?
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.