Skip to content

Commit

Permalink
(c2rust-analyze) Updated do_unify docs after the renaming.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkysen committed Feb 16, 2023
1 parent 3b071f7 commit f05df65
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions c2rust-analyze/src/dataflow/type_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,21 @@ impl<'tcx> TypeChecker<'tcx, '_> {
}
}

/// Unify corresponding `PointerId`s in `lty1` and `lty2`.
/// Unify corresponding [`PointerId`]s in `pl_lty` and `rv_lty`.
///
/// The two inputs must have compatible ([safely transmutable](is_transmutable_to)) underlying types.
/// For any position where the underlying type has a pointer,
/// this function unifies the `PointerId`s that `lty1` and `lty2` have at
/// that position. For example, given `lty1 = *mut /*l1*/ *const /*l2*/ u8` and `lty2 = *mut
/// /*l3*/ *const /*l4*/ u8`, this function will unify `l1` with `l3` and `l2` with `l4`.
/// this function unifies the [`PointerId`]s that `pl_lty` and `rv_lty` have at that position.
/// For example, given
///
/// ```
/// # fn(
/// pl_lty: *mut /*l1*/ *const /*l2*/ u8,
/// rv_lty: *mut /*l3*/ *const /*l4*/ u8,
/// # ) {}
/// ```
///
/// this function will unify `l1` with `l3` and `l2` with `l4`.
fn do_unify(&mut self, pl_lty: LTy<'tcx>, rv_lty: LTy<'tcx>) {
let pl_ty = pl_lty.ty;
let rv_ty = rv_lty.ty;
Expand Down

0 comments on commit f05df65

Please sign in to comment.