Skip to content

Commit

Permalink
(c2rust-analyze) Clarified that do_unify now requires only compat…
Browse files Browse the repository at this point in the history
…ible/safetly transmutable types, not identical.
  • Loading branch information
kkysen committed Feb 16, 2023
1 parent 19d0dac commit 255a8be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions c2rust-analyze/src/dataflow/type_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ impl<'tcx> TypeChecker<'tcx, '_> {

/// Unify corresponding `PointerId`s in `lty1` and `lty2`.
///
/// The two inputs must have identical underlying types. For any position where the underlying
/// type has a pointer, this function unifies the `PointerId`s that `lty1` and `lty2` have at
/// The two inputs must have compatible ([safely transmutable](are_transmutable)) 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`.
fn do_unify(&mut self, lty1: LTy<'tcx>, lty2: LTy<'tcx>) {
Expand Down

0 comments on commit 255a8be

Please sign in to comment.