1
Fork 0

Add CopyForDeref to custom MIR

This commit is contained in:
Andy Wang 2023-05-15 12:05:10 +02:00
parent 0bcfd2d96e
commit c3ab4f28d3
No known key found for this signature in database
GPG key ID: 181B49F9F38F3374
4 changed files with 30 additions and 0 deletions

View file

@ -154,6 +154,7 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
Ok(Rvalue::BinaryOp(BinOp::Offset, Box::new((ptr, offset))))
},
@call("mir_len", args) => Ok(Rvalue::Len(self.parse_place(args[0])?)),
@call("mir_copy_for_deref", args) => Ok(Rvalue::CopyForDeref(self.parse_place(args[0])?)),
ExprKind::Borrow { borrow_kind, arg } => Ok(
Rvalue::Ref(self.tcx.lifetimes.re_erased, *borrow_kind, self.parse_place(*arg)?)
),