Skip to content

Commit

Permalink
analyze: mir_op: comment explaining SubLoc to WhichPlace conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
spernsteiner committed Dec 9, 2024
1 parent 01fcc81 commit 8f40e87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions c2rust-analyze/src/rewrite/expr/mir_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ impl<'a, 'tcx> ExprRewriteVisitor<'a, 'tcx> {
}
SubLoc::Rvalue => {
which = Some(last_use::WhichPlace::Operand(0));
// Note there may be more entries in `self.sub_loc` giving a more precise
// position, as in `[SubLoc::Rvalue, SubLoc::CallArg(0)]`. We keep looping
// over `self.sub_loc` and take the last (most precise) entry.
}
SubLoc::CallArg(i) => {
// In a call, `WhichPlace::Operand(0)` refers to the callee function.
Expand Down

0 comments on commit 8f40e87

Please sign in to comment.