@@ -220,7 +220,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
220220 // or pin-ergonomics.
221221 match * b. kind ( ) {
222222 ty:: RawPtr ( _, b_mutbl) => {
223- return self . coerce_unsafe_ptr ( a, b, b_mutbl) ;
223+ return self . coerce_raw_ptr ( a, b, b_mutbl) ;
224224 }
225225 ty:: Ref ( r_b, _, mutbl_b) => {
226226 return self . coerce_borrowed_pointer ( a, b, r_b, mutbl_b) ;
@@ -1035,13 +1035,13 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
10351035 }
10361036 }
10371037
1038- fn coerce_unsafe_ptr (
1038+ fn coerce_raw_ptr (
10391039 & self ,
10401040 a : Ty < ' tcx > ,
10411041 b : Ty < ' tcx > ,
10421042 mutbl_b : hir:: Mutability ,
10431043 ) -> CoerceResult < ' tcx > {
1044- debug ! ( "coerce_unsafe_ptr (a={:?}, b={:?})" , a, b) ;
1044+ debug ! ( "coerce_raw_ptr (a={:?}, b={:?})" , a, b) ;
10451045
10461046 let ( is_ref, mt_a) = match * a. kind ( ) {
10471047 ty:: Ref ( _, ty, mutbl) => ( true , ty:: TypeAndMut { ty, mutbl } ) ,
@@ -1051,21 +1051,21 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
10511051 coerce_mutbls ( mt_a. mutbl , mutbl_b) ?;
10521052
10531053 // 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
10561056 // representation, we still register an Adjust::DerefRef so that
10571057 // regionck knows that the region for `a` must be valid here.
10581058 if is_ref {
1059- self . unify_and ( a_unsafe , b, |target| {
1059+ self . unify_and ( a_raw , b, |target| {
10601060 vec ! [ Adjustment { kind: Adjust :: Deref ( None ) , target: mt_a. ty } , Adjustment {
10611061 kind: Adjust :: Borrow ( AutoBorrow :: RawPtr ( mutbl_b) ) ,
10621062 target,
10631063 } ]
10641064 } )
10651065 } 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 ) ) )
10671067 } else {
1068- self . unify_and ( a_unsafe , b, identity)
1068+ self . unify_and ( a_raw , b, identity)
10691069 }
10701070 }
10711071}
0 commit comments