@@ -2,8 +2,7 @@ use super::DataflowConstraints;
2
2
use crate :: c_void_casts:: CVoidCastDirection ;
3
3
use crate :: context:: { AnalysisCtxt , LTy , PermissionSet , PointerId } ;
4
4
use crate :: util:: {
5
- describe_rvalue, is_null_const, is_transmutable_ptr_cast, is_transmutable_to, ty_callee,
6
- Callee , RvalueDesc ,
5
+ describe_rvalue, is_null_const, is_transmutable_ptr_cast, ty_callee, Callee , RvalueDesc ,
7
6
} ;
8
7
use assert_matches:: assert_matches;
9
8
use rustc_hir:: def_id:: DefId ;
@@ -276,7 +275,7 @@ impl<'tcx> TypeChecker<'tcx, '_> {
276
275
277
276
/// Unify corresponding [`PointerId`]s in `pl_lty` and `rv_lty`.
278
277
///
279
- /// The two inputs must have compatible ([safely transmutable](is_transmutable_to)) underlying types.
278
+ /// The two inputs must have identical underlying types.
280
279
/// For any position where the underlying type has a pointer,
281
280
/// this function unifies the [`PointerId`]s that `pl_lty` and `rv_lty` have at that position.
282
281
/// For example, given
@@ -292,10 +291,7 @@ impl<'tcx> TypeChecker<'tcx, '_> {
292
291
fn do_unify ( & mut self , pl_lty : LTy < ' tcx > , rv_lty : LTy < ' tcx > ) {
293
292
let rv_ty = self . acx . tcx ( ) . erase_regions ( rv_lty. ty ) ;
294
293
let pl_ty = self . acx . tcx ( ) . erase_regions ( pl_lty. ty ) ;
295
- assert ! (
296
- is_transmutable_to( rv_ty, pl_ty) ,
297
- "types not transmutable (compatible), so PointerId unification cannot be done: *{rv_ty:?} as *{pl_ty:?}" ,
298
- ) ;
294
+ assert_eq ! ( rv_ty, pl_ty) ;
299
295
for ( sub_lty1, sub_lty2) in pl_lty. iter ( ) . zip ( rv_lty. iter ( ) ) {
300
296
eprintln ! ( "equate {:?} = {:?}" , sub_lty1, sub_lty2) ;
301
297
if sub_lty1. label != PointerId :: NONE || sub_lty2. label != PointerId :: NONE {
0 commit comments