Skip to content

Commit ba95182

Browse files
committed
analyze: mir_op: comment explaining SubLoc to WhichPlace conversion
1 parent 8ffe68d commit ba95182

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

c2rust-analyze/src/rewrite/expr/mir_op.rs

+3
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ impl<'a, 'tcx> ExprRewriteVisitor<'a, 'tcx> {
417417
}
418418
SubLoc::Rvalue => {
419419
which = Some(last_use::WhichPlace::Operand(0));
420+
// Note there may be more entries in `self.sub_loc` giving a more precise
421+
// position, as in `[SubLoc::Rvalue, SubLoc::CallArg(0)]`. We keep looping
422+
// over `self.sub_loc` and take the last (most precise) entry.
420423
}
421424
SubLoc::CallArg(i) => {
422425
// In a call, `WhichPlace::Operand(0)` refers to the callee function.

0 commit comments

Comments
 (0)