1
Fork 0

Update match branches

This updates all places where match branches check on StatementKind or UseContext.
This doesn't properly implement them, but adds TODOs where they are, and also adds some best
guesses to what they should be in some cases.
This commit is contained in:
kadmin 2020-10-05 22:53:00 +00:00
parent 72c734d001
commit 89f45ed9f3
19 changed files with 1346 additions and 24 deletions

View file

@ -1668,7 +1668,7 @@ impl Debug for Statement<'_> {
ref src,
ref dst,
ref size,
}) => write!(fmt, "copy_nonoverlapping(src={:?}, dst={:?},bytes={:?})", src, dst, size),
}) => write!(fmt, "copy_nonoverlapping(src={:?}, dst={:?}, size={:?})", src, dst, size),
Nop => write!(fmt, "nop"),
}
}
@ -1682,8 +1682,8 @@ pub struct Coverage {
#[derive(Clone, Debug, PartialEq, TyEncodable, TyDecodable, HashStable, TypeFoldable)]
pub struct CopyNonOverlapping<'tcx> {
pub src: Place<'tcx>,
pub dst: Place<'tcx>,
pub src: Operand<'tcx>,
pub dst: Operand<'tcx>,
pub size: Operand<'tcx>,
}

View file

@ -441,14 +441,12 @@ macro_rules! make_mir_visitor {
ref $($mutability)? dst,
ref $($mutability)? size,
}) => {
self.visit_place(
self.visit_operand(
src,
PlaceContext::NonMutatingUse(NonMutatingUseContext::CopyNonOverlapping),
location
);
self.visit_place(
self.visit_operand(
dst,
PlaceContext::MutatingUse(MutatingUseContext::CopyNonOverlapping),
location
);
self.visit_operand(size, location)
@ -1168,8 +1166,6 @@ pub enum NonMutatingUseContext {
/// f(&x.y);
///
Projection,
/// Source from copy_nonoverlapping.
CopyNonOverlapping,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
@ -1199,8 +1195,6 @@ pub enum MutatingUseContext {
Projection,
/// Retagging, a "Stacked Borrows" shadow state operation
Retag,
/// Memory written to in copy_nonoverlapping.
CopyNonOverlapping,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]