@@ -101,12 +101,12 @@ impl<T: ?Sized> RwLock<T> {
101
101
/// # })
102
102
/// ```
103
103
pub async fn read ( & self ) -> RwLockReadGuard < ' _ , T > {
104
- pub struct ReadFuture < ' a , T > {
104
+ pub struct ReadFuture < ' a , T : ? Sized > {
105
105
lock : & ' a RwLock < T > ,
106
106
opt_key : Option < usize > ,
107
107
}
108
108
109
- impl < ' a , T > Future for ReadFuture < ' a , T > {
109
+ impl < ' a , T : ? Sized > Future for ReadFuture < ' a , T > {
110
110
type Output = RwLockReadGuard < ' a , T > ;
111
111
112
112
fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
@@ -133,7 +133,7 @@ impl<T: ?Sized> RwLock<T> {
133
133
}
134
134
}
135
135
136
- impl < T > Drop for ReadFuture < ' _ , T > {
136
+ impl < T : ? Sized > Drop for ReadFuture < ' _ , T > {
137
137
fn drop ( & mut self ) {
138
138
// If the current task is still in the set, that means it is being cancelled now.
139
139
if let Some ( key) = self . opt_key {
@@ -226,12 +226,12 @@ impl<T: ?Sized> RwLock<T> {
226
226
/// # })
227
227
/// ```
228
228
pub async fn write ( & self ) -> RwLockWriteGuard < ' _ , T > {
229
- pub struct WriteFuture < ' a , T > {
229
+ pub struct WriteFuture < ' a , T : ? Sized > {
230
230
lock : & ' a RwLock < T > ,
231
231
opt_key : Option < usize > ,
232
232
}
233
233
234
- impl < ' a , T > Future for WriteFuture < ' a , T > {
234
+ impl < ' a , T : ? Sized > Future for WriteFuture < ' a , T > {
235
235
type Output = RwLockWriteGuard < ' a , T > ;
236
236
237
237
fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
@@ -258,7 +258,7 @@ impl<T: ?Sized> RwLock<T> {
258
258
}
259
259
}
260
260
261
- impl < T > Drop for WriteFuture < ' _ , T > {
261
+ impl < T : ? Sized > Drop for WriteFuture < ' _ , T > {
262
262
fn drop ( & mut self ) {
263
263
// If the current task is still in the set, that means it is being cancelled now.
264
264
if let Some ( key) = self . opt_key {
0 commit comments