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 824662d78a
commit 6f60dd884e

View file

@ -210,7 +210,7 @@ fn check_statement(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: DefId, statemen
StatementKind::Assign(box (place, rval)) => {
check_place(tcx, *place, span, body)?;
check_rvalue(tcx, body, def_id, rval, span)
},
}
StatementKind::FakeRead(_, place) |
// just an assignment
@ -218,6 +218,13 @@ fn check_statement(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: DefId, statemen
StatementKind::LlvmInlineAsm { .. } => Err((span, "cannot use inline assembly in const fn".into())),
StatementKind::CopyNonOverlapping(box rustc_middle::mir::CopyNonOverlapping{
dst, src, size,
}) => {
check_operand(tcx, dst, span, body)?;
check_operand(tcx, src, span, body)?;
check_operand(tcx, size, span, body)
},
// These are all NOPs
StatementKind::StorageLive(_)
| StatementKind::StorageDead(_)