@@ -1101,69 +1101,69 @@ impl<T: ::hash::Hash> ::hash::Hash for ManuallyDrop<T> {
1101
1101
/// value implements the `Unpin` trait.
1102
1102
#[ unstable( feature = "pin" , issue = "49150" ) ]
1103
1103
#[ fundamental]
1104
- pub struct Pin < ' a , T : ?Sized + ' a > {
1104
+ pub struct PinMut < ' a , T : ?Sized + ' a > {
1105
1105
inner : & ' a mut T ,
1106
1106
}
1107
1107
1108
1108
#[ unstable( feature = "pin" , issue = "49150" ) ]
1109
- impl < ' a , T : ?Sized + Unpin > Pin < ' a , T > {
1110
- /// Construct a new `Pin ` around a reference to some data of a type that
1109
+ impl < ' a , T : ?Sized + Unpin > PinMut < ' a , T > {
1110
+ /// Construct a new `PinMut ` around a reference to some data of a type that
1111
1111
/// implements `Unpin`.
1112
1112
#[ unstable( feature = "pin" , issue = "49150" ) ]
1113
- pub fn new ( reference : & ' a mut T ) -> Pin < ' a , T > {
1114
- Pin { inner : reference }
1113
+ pub fn new ( reference : & ' a mut T ) -> PinMut < ' a , T > {
1114
+ PinMut { inner : reference }
1115
1115
}
1116
1116
}
1117
1117
1118
1118
1119
1119
#[ unstable( feature = "pin" , issue = "49150" ) ]
1120
- impl < ' a , T : ?Sized > Pin < ' a , T > {
1121
- /// Construct a new `Pin ` around a reference to some data of a type that
1120
+ impl < ' a , T : ?Sized > PinMut < ' a , T > {
1121
+ /// Construct a new `PinMut ` around a reference to some data of a type that
1122
1122
/// may or may not implement `Unpin`.
1123
1123
///
1124
1124
/// This constructor is unsafe because we do not know what will happen with
1125
1125
/// that data after the reference ends. If you cannot guarantee that the
1126
1126
/// data will never move again, calling this constructor is invalid.
1127
1127
#[ unstable( feature = "pin" , issue = "49150" ) ]
1128
- pub unsafe fn new_unchecked ( reference : & ' a mut T ) -> Pin < ' a , T > {
1129
- Pin { inner : reference }
1128
+ pub unsafe fn new_unchecked ( reference : & ' a mut T ) -> PinMut < ' a , T > {
1129
+ PinMut { inner : reference }
1130
1130
}
1131
1131
1132
- /// Borrow a Pin for a shorter lifetime than it already has.
1132
+ /// Borrow a PinMut for a shorter lifetime than it already has.
1133
1133
#[ unstable( feature = "pin" , issue = "49150" ) ]
1134
- pub fn borrow < ' b > ( this : & ' b mut Pin < ' a , T > ) -> Pin < ' b , T > {
1135
- Pin { inner : this. inner }
1134
+ pub fn borrow < ' b > ( this : & ' b mut PinMut < ' a , T > ) -> PinMut < ' b , T > {
1135
+ PinMut { inner : this. inner }
1136
1136
}
1137
1137
1138
- /// Get a mutable reference to the data inside of this `Pin `.
1138
+ /// Get a mutable reference to the data inside of this `PinMut `.
1139
1139
///
1140
1140
/// This function is unsafe. You must guarantee that you will never move
1141
1141
/// the data out of the mutable reference you receive when you call this
1142
1142
/// function.
1143
1143
#[ unstable( feature = "pin" , issue = "49150" ) ]
1144
- pub unsafe fn get_mut < ' b > ( this : & ' b mut Pin < ' a , T > ) -> & ' b mut T {
1144
+ pub unsafe fn get_mut < ' b > ( this : & ' b mut PinMut < ' a , T > ) -> & ' b mut T {
1145
1145
this. inner
1146
1146
}
1147
1147
1148
1148
/// Construct a new pin by mapping the interior value.
1149
1149
///
1150
- /// For example, if you wanted to get a `Pin ` of a field of something, you
1150
+ /// For example, if you wanted to get a `PinMut ` of a field of something, you
1151
1151
/// could use this to get access to that field in one line of code.
1152
1152
///
1153
1153
/// This function is unsafe. You must guarantee that the data you return
1154
1154
/// will not move so long as the argument value does not move (for example,
1155
1155
/// because it is one of the fields of that value), and also that you do
1156
1156
/// not move out of the argument you receive to the interior function.
1157
1157
#[ unstable( feature = "pin" , issue = "49150" ) ]
1158
- pub unsafe fn map < ' b , U , F > ( this : & ' b mut Pin < ' a , T > , f : F ) -> Pin < ' b , U > where
1158
+ pub unsafe fn map < ' b , U , F > ( this : & ' b mut PinMut < ' a , T > , f : F ) -> PinMut < ' b , U > where
1159
1159
F : FnOnce ( & mut T ) -> & mut U
1160
1160
{
1161
- Pin { inner : f ( this. inner ) }
1161
+ PinMut { inner : f ( this. inner ) }
1162
1162
}
1163
1163
}
1164
1164
1165
1165
#[ unstable( feature = "pin" , issue = "49150" ) ]
1166
- impl < ' a , T : ?Sized > Deref for Pin < ' a , T > {
1166
+ impl < ' a , T : ?Sized > Deref for PinMut < ' a , T > {
1167
1167
type Target = T ;
1168
1168
1169
1169
fn deref ( & self ) -> & T {
@@ -1172,35 +1172,35 @@ impl<'a, T: ?Sized> Deref for Pin<'a, T> {
1172
1172
}
1173
1173
1174
1174
#[ unstable( feature = "pin" , issue = "49150" ) ]
1175
- impl < ' a , T : ?Sized + Unpin > DerefMut for Pin < ' a , T > {
1175
+ impl < ' a , T : ?Sized + Unpin > DerefMut for PinMut < ' a , T > {
1176
1176
fn deref_mut ( & mut self ) -> & mut T {
1177
1177
self . inner
1178
1178
}
1179
1179
}
1180
1180
1181
1181
#[ unstable( feature = "pin" , issue = "49150" ) ]
1182
- impl < ' a , T : fmt:: Debug + ?Sized > fmt:: Debug for Pin < ' a , T > {
1182
+ impl < ' a , T : fmt:: Debug + ?Sized > fmt:: Debug for PinMut < ' a , T > {
1183
1183
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1184
1184
fmt:: Debug :: fmt ( & * * self , f)
1185
1185
}
1186
1186
}
1187
1187
1188
1188
#[ unstable( feature = "pin" , issue = "49150" ) ]
1189
- impl < ' a , T : fmt:: Display + ?Sized > fmt:: Display for Pin < ' a , T > {
1189
+ impl < ' a , T : fmt:: Display + ?Sized > fmt:: Display for PinMut < ' a , T > {
1190
1190
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1191
1191
fmt:: Display :: fmt ( & * * self , f)
1192
1192
}
1193
1193
}
1194
1194
1195
1195
#[ unstable( feature = "pin" , issue = "49150" ) ]
1196
- impl < ' a , T : ?Sized > fmt:: Pointer for Pin < ' a , T > {
1196
+ impl < ' a , T : ?Sized > fmt:: Pointer for PinMut < ' a , T > {
1197
1197
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1198
1198
fmt:: Pointer :: fmt ( & ( & * self . inner as * const T ) , f)
1199
1199
}
1200
1200
}
1201
1201
1202
1202
#[ unstable( feature = "pin" , issue = "49150" ) ]
1203
- impl < ' a , T : ?Sized + Unsize < U > , U : ?Sized > CoerceUnsized < Pin < ' a , U > > for Pin < ' a , T > { }
1203
+ impl < ' a , T : ?Sized + Unsize < U > , U : ?Sized > CoerceUnsized < PinMut < ' a , U > > for PinMut < ' a , T > { }
1204
1204
1205
1205
#[ unstable( feature = "pin" , issue = "49150" ) ]
1206
- unsafe impl < ' a , T : ?Sized > Unpin for Pin < ' a , T > { }
1206
+ unsafe impl < ' a , T : ?Sized > Unpin for PinMut < ' a , T > { }
0 commit comments