Skip to content

Commit

Permalink
analyze: rewrite::unlower: add doc comments for fn record + fn record…
Browse files Browse the repository at this point in the history
…_desc
  • Loading branch information
spernsteiner committed Oct 9, 2023
1 parent 5aceaaf commit 60aa23e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions c2rust-analyze/src/rewrite/expr/unlower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,16 @@ impl<'a, 'tcx> UnlowerVisitor<'a, 'tcx> {
.either(|stmt| stmt.source_info.span, |term| term.source_info.span)
}

/// Record an `unlower_map` entry indicating that MIR location `loc, sub_loc` corresponds to
/// the HIR expression `ex`.
fn record(&mut self, loc: Location, sub_loc: &[SubLoc], ex: &hir::Expr) {
self.record_desc(loc, sub_loc, ex, MirOriginDesc::Expr);
}

/// Like [`record`][Self::record], but also takes a [`MirOriginDesc`] to indicate how the MIR
/// location `loc, sub_loc` relates to the HIR expression `desc`. For example, this can be
/// used to record that a particular piece of MIR loads/stores a temporary used in the
/// evaluation of `ex`.
fn record_desc(
&mut self,
loc: Location,
Expand Down

0 comments on commit 60aa23e

Please sign in to comment.