@@ -219,7 +219,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
219219 // or pin-ergonomics.
220220 match * b. kind ( ) {
221221 ty:: RawPtr ( _, b_mutbl) => {
222- return self . coerce_unsafe_ptr ( a, b, b_mutbl) ;
222+ return self . coerce_raw_ptr ( a, b, b_mutbl) ;
223223 }
224224 ty:: Ref ( r_b, _, mutbl_b) => {
225225 return self . coerce_borrowed_pointer ( a, b, r_b, mutbl_b) ;
@@ -1017,13 +1017,13 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
10171017 }
10181018 }
10191019
1020- fn coerce_unsafe_ptr (
1020+ fn coerce_raw_ptr (
10211021 & self ,
10221022 a : Ty < ' tcx > ,
10231023 b : Ty < ' tcx > ,
10241024 mutbl_b : hir:: Mutability ,
10251025 ) -> CoerceResult < ' tcx > {
1026- debug ! ( "coerce_unsafe_ptr (a={:?}, b={:?})" , a, b) ;
1026+ debug ! ( "coerce_raw_ptr (a={:?}, b={:?})" , a, b) ;
10271027
10281028 let ( is_ref, mt_a) = match * a. kind ( ) {
10291029 ty:: Ref ( _, ty, mutbl) => ( true , ty:: TypeAndMut { ty, mutbl } ) ,
@@ -1033,21 +1033,21 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
10331033 coerce_mutbls ( mt_a. mutbl , mutbl_b) ?;
10341034
10351035 // 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
10381038 // representation, we still register an Adjust::DerefRef so that
10391039 // regionck knows that the region for `a` must be valid here.
10401040 if is_ref {
1041- self . unify_and ( a_unsafe , b, |target| {
1041+ self . unify_and ( a_raw , b, |target| {
10421042 vec ! [
10431043 Adjustment { kind: Adjust :: Deref ( None ) , target: mt_a. ty } ,
10441044 Adjustment { kind: Adjust :: Borrow ( AutoBorrow :: RawPtr ( mutbl_b) ) , target } ,
10451045 ]
10461046 } )
10471047 } 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 ) ) )
10491049 } else {
1050- self . unify_and ( a_unsafe , b, identity)
1050+ self . unify_and ( a_raw , b, identity)
10511051 }
10521052 }
10531053}
0 commit comments