@@ -219,7 +219,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
219
219
// or pin-ergonomics.
220
220
match * b. kind ( ) {
221
221
ty:: RawPtr ( _, b_mutbl) => {
222
- return self . coerce_unsafe_ptr ( a, b, b_mutbl) ;
222
+ return self . coerce_raw_ptr ( a, b, b_mutbl) ;
223
223
}
224
224
ty:: Ref ( r_b, _, mutbl_b) => {
225
225
return self . coerce_borrowed_pointer ( a, b, r_b, mutbl_b) ;
@@ -1017,13 +1017,13 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
1017
1017
}
1018
1018
}
1019
1019
1020
- fn coerce_unsafe_ptr (
1020
+ fn coerce_raw_ptr (
1021
1021
& self ,
1022
1022
a : Ty < ' tcx > ,
1023
1023
b : Ty < ' tcx > ,
1024
1024
mutbl_b : hir:: Mutability ,
1025
1025
) -> CoerceResult < ' tcx > {
1026
- debug ! ( "coerce_unsafe_ptr (a={:?}, b={:?})" , a, b) ;
1026
+ debug ! ( "coerce_raw_ptr (a={:?}, b={:?})" , a, b) ;
1027
1027
1028
1028
let ( is_ref, mt_a) = match * a. kind ( ) {
1029
1029
ty:: Ref ( _, ty, mutbl) => ( true , ty:: TypeAndMut { ty, mutbl } ) ,
@@ -1033,21 +1033,21 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
1033
1033
coerce_mutbls ( mt_a. mutbl , mutbl_b) ?;
1034
1034
1035
1035
// Check that the types which they point at are compatible.
1036
- let a_unsafe = Ty :: new_ptr ( self . tcx , mt_a. ty , mutbl_b) ;
1037
- // Although references and unsafe ptrs have the same
1036
+ let a_raw = Ty :: new_ptr ( self . tcx , mt_a. ty , mutbl_b) ;
1037
+ // Although references and raw ptrs have the same
1038
1038
// representation, we still register an Adjust::DerefRef so that
1039
1039
// regionck knows that the region for `a` must be valid here.
1040
1040
if is_ref {
1041
- self . unify_and ( a_unsafe , b, |target| {
1041
+ self . unify_and ( a_raw , b, |target| {
1042
1042
vec ! [
1043
1043
Adjustment { kind: Adjust :: Deref ( None ) , target: mt_a. ty } ,
1044
1044
Adjustment { kind: Adjust :: Borrow ( AutoBorrow :: RawPtr ( mutbl_b) ) , target } ,
1045
1045
]
1046
1046
} )
1047
1047
} else if mt_a. mutbl != mutbl_b {
1048
- self . unify_and ( a_unsafe , b, simple ( Adjust :: Pointer ( PointerCoercion :: MutToConstPointer ) ) )
1048
+ self . unify_and ( a_raw , b, simple ( Adjust :: Pointer ( PointerCoercion :: MutToConstPointer ) ) )
1049
1049
} else {
1050
- self . unify_and ( a_unsafe , b, identity)
1050
+ self . unify_and ( a_raw , b, identity)
1051
1051
}
1052
1052
}
1053
1053
}
0 commit comments