Skip to content

Commit 6f60dd8

Browse files
committed
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.
1 parent 824662d commit 6f60dd8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,21 @@ fn check_statement(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: DefId, statemen
210210
StatementKind::Assign(box (place, rval)) => {
211211
check_place(tcx, *place, span, body)?;
212212
check_rvalue(tcx, body, def_id, rval, span)
213-
},
213+
}
214214

215215
StatementKind::FakeRead(_, place) |
216216
// just an assignment
217217
StatementKind::SetDiscriminant { place, .. } => check_place(tcx, **place, span, body),
218218

219219
StatementKind::LlvmInlineAsm { .. } => Err((span, "cannot use inline assembly in const fn".into())),
220220

221+
StatementKind::CopyNonOverlapping(box rustc_middle::mir::CopyNonOverlapping{
222+
dst, src, size,
223+
}) => {
224+
check_operand(tcx, dst, span, body)?;
225+
check_operand(tcx, src, span, body)?;
226+
check_operand(tcx, size, span, body)
227+
},
221228
// These are all NOPs
222229
StatementKind::StorageLive(_)
223230
| StatementKind::StorageDead(_)

0 commit comments

Comments
 (0)