@@ -220,7 +220,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
220
220
// or pin-ergonomics.
221
221
match * b. kind ( ) {
222
222
ty:: RawPtr ( _, b_mutbl) => {
223
- return self . coerce_unsafe_ptr ( a, b, b_mutbl) ;
223
+ return self . coerce_raw_ptr ( a, b, b_mutbl) ;
224
224
}
225
225
ty:: Ref ( r_b, _, mutbl_b) => {
226
226
return self . coerce_borrowed_pointer ( a, b, r_b, mutbl_b) ;
@@ -1035,13 +1035,13 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
1035
1035
}
1036
1036
}
1037
1037
1038
- fn coerce_unsafe_ptr (
1038
+ fn coerce_raw_ptr (
1039
1039
& self ,
1040
1040
a : Ty < ' tcx > ,
1041
1041
b : Ty < ' tcx > ,
1042
1042
mutbl_b : hir:: Mutability ,
1043
1043
) -> CoerceResult < ' tcx > {
1044
- debug ! ( "coerce_unsafe_ptr (a={:?}, b={:?})" , a, b) ;
1044
+ debug ! ( "coerce_raw_ptr (a={:?}, b={:?})" , a, b) ;
1045
1045
1046
1046
let ( is_ref, mt_a) = match * a. kind ( ) {
1047
1047
ty:: Ref ( _, ty, mutbl) => ( true , ty:: TypeAndMut { ty, mutbl } ) ,
@@ -1051,21 +1051,21 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
1051
1051
coerce_mutbls ( mt_a. mutbl , mutbl_b) ?;
1052
1052
1053
1053
// Check that the types which they point at are compatible.
1054
- let a_unsafe = Ty :: new_ptr ( self . tcx , mt_a. ty , mutbl_b) ;
1055
- // Although references and unsafe ptrs have the same
1054
+ let a_raw = Ty :: new_ptr ( self . tcx , mt_a. ty , mutbl_b) ;
1055
+ // Although references and raw ptrs have the same
1056
1056
// representation, we still register an Adjust::DerefRef so that
1057
1057
// regionck knows that the region for `a` must be valid here.
1058
1058
if is_ref {
1059
- self . unify_and ( a_unsafe , b, |target| {
1059
+ self . unify_and ( a_raw , b, |target| {
1060
1060
vec ! [ Adjustment { kind: Adjust :: Deref ( None ) , target: mt_a. ty } , Adjustment {
1061
1061
kind: Adjust :: Borrow ( AutoBorrow :: RawPtr ( mutbl_b) ) ,
1062
1062
target,
1063
1063
} ]
1064
1064
} )
1065
1065
} else if mt_a. mutbl != mutbl_b {
1066
- self . unify_and ( a_unsafe , b, simple ( Adjust :: Pointer ( PointerCoercion :: MutToConstPointer ) ) )
1066
+ self . unify_and ( a_raw , b, simple ( Adjust :: Pointer ( PointerCoercion :: MutToConstPointer ) ) )
1067
1067
} else {
1068
- self . unify_and ( a_unsafe , b, identity)
1068
+ self . unify_and ( a_raw , b, identity)
1069
1069
}
1070
1070
}
1071
1071
}
0 commit comments