@@ -39,13 +39,13 @@ use crate::hash::{Hash, Hasher};
39
39
///
40
40
/// # Usage
41
41
///
42
- /// Raw pointers can be decomposed into the data address and metadata components
42
+ /// Raw pointers can be decomposed into the data pointer and metadata components
43
43
/// with their [`to_raw_parts`] method.
44
44
///
45
45
/// Alternatively, metadata alone can be extracted with the [`metadata`] function.
46
46
/// A reference can be passed to [`metadata`] and implicitly coerced.
47
47
///
48
- /// A (possibly-wide) pointer can be put back together from its address and metadata
48
+ /// A (possibly-wide) pointer can be put back together from its data pointer and metadata
49
49
/// with [`from_raw_parts`] or [`from_raw_parts_mut`].
50
50
///
51
51
/// [`to_raw_parts`]: *const::to_raw_parts
@@ -98,7 +98,7 @@ pub const fn metadata<T: ?Sized>(ptr: *const T) -> <T as Pointee>::Metadata {
98
98
unsafe { PtrRepr { const_ptr: ptr } . components. metadata }
99
99
}
100
100
101
- /// Forms a (possibly-wide) raw pointer from a data address and metadata.
101
+ /// Forms a (possibly-wide) raw pointer from a data pointer and metadata.
102
102
///
103
103
/// This function is safe but the returned pointer is not necessarily safe to dereference.
104
104
/// For slices, see the documentation of [`slice::from_raw_parts`] for safety requirements.
@@ -109,13 +109,13 @@ pub const fn metadata<T: ?Sized>(ptr: *const T) -> <T as Pointee>::Metadata {
109
109
#[ rustc_const_unstable( feature = "ptr_metadata" , issue = "81513" ) ]
110
110
#[ inline]
111
111
pub const fn from_raw_parts < T : ?Sized > (
112
- data_address : * const ( ) ,
112
+ data_pointer : * const ( ) ,
113
113
metadata : <T as Pointee >:: Metadata ,
114
114
) -> * const T {
115
115
// SAFETY: Accessing the value from the `PtrRepr` union is safe since *const T
116
116
// and PtrComponents<T> have the same memory layouts. Only std can make this
117
117
// guarantee.
118
- unsafe { PtrRepr { components : PtrComponents { data_address , metadata } } . const_ptr }
118
+ unsafe { PtrRepr { components : PtrComponents { data_pointer , metadata } } . const_ptr }
119
119
}
120
120
121
121
/// Performs the same functionality as [`from_raw_parts`], except that a
@@ -126,13 +126,13 @@ pub const fn from_raw_parts<T: ?Sized>(
126
126
#[ rustc_const_unstable( feature = "ptr_metadata" , issue = "81513" ) ]
127
127
#[ inline]
128
128
pub const fn from_raw_parts_mut < T : ?Sized > (
129
- data_address : * mut ( ) ,
129
+ data_pointer : * mut ( ) ,
130
130
metadata : <T as Pointee >:: Metadata ,
131
131
) -> * mut T {
132
132
// SAFETY: Accessing the value from the `PtrRepr` union is safe since *const T
133
133
// and PtrComponents<T> have the same memory layouts. Only std can make this
134
134
// guarantee.
135
- unsafe { PtrRepr { components : PtrComponents { data_address , metadata } } . mut_ptr }
135
+ unsafe { PtrRepr { components : PtrComponents { data_pointer , metadata } } . mut_ptr }
136
136
}
137
137
138
138
#[ repr( C ) ]
@@ -144,7 +144,7 @@ union PtrRepr<T: ?Sized> {
144
144
145
145
#[ repr( C ) ]
146
146
struct PtrComponents < T : ?Sized > {
147
- data_address : * const ( ) ,
147
+ data_pointer : * const ( ) ,
148
148
metadata : <T as Pointee >:: Metadata ,
149
149
}
150
150
0 commit comments