Lower the assume intrinsic to a MIR statement
This commit is contained in:
parent
3c72788461
commit
3f07645120
33 changed files with 212 additions and 30 deletions
|
@ -679,6 +679,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
|
|||
| StatementKind::AscribeUserType(..)
|
||||
| StatementKind::Coverage(..)
|
||||
| StatementKind::CopyNonOverlapping(..)
|
||||
| StatementKind::Assume(..)
|
||||
| StatementKind::Nop => {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -636,6 +636,15 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
|
|||
);
|
||||
}
|
||||
}
|
||||
StatementKind::Assume(box ref op) => {
|
||||
let ty = op.ty(&self.body.local_decls, self.tcx);
|
||||
if !ty.is_bool() {
|
||||
self.fail(
|
||||
location,
|
||||
format!("`assume` argument must be `bool`, but got: `{}`", ty),
|
||||
);
|
||||
}
|
||||
}
|
||||
StatementKind::CopyNonOverlapping(box rustc_middle::mir::CopyNonOverlapping {
|
||||
ref src,
|
||||
ref dst,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue