@@ -101,12 +101,12 @@ impl<T: ?Sized> RwLock<T> {
101101 /// # })
102102 /// ```
103103 pub async fn read ( & self ) -> RwLockReadGuard < ' _ , T > {
104- pub struct ReadFuture < ' a , T > {
104+ pub struct ReadFuture < ' a , T : ? Sized > {
105105 lock : & ' a RwLock < T > ,
106106 opt_key : Option < usize > ,
107107 }
108108
109- impl < ' a , T > Future for ReadFuture < ' a , T > {
109+ impl < ' a , T : ? Sized > Future for ReadFuture < ' a , T > {
110110 type Output = RwLockReadGuard < ' a , T > ;
111111
112112 fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
@@ -133,7 +133,7 @@ impl<T: ?Sized> RwLock<T> {
133133 }
134134 }
135135
136- impl < T > Drop for ReadFuture < ' _ , T > {
136+ impl < T : ? Sized > Drop for ReadFuture < ' _ , T > {
137137 fn drop ( & mut self ) {
138138 // If the current task is still in the set, that means it is being cancelled now.
139139 if let Some ( key) = self . opt_key {
@@ -226,12 +226,12 @@ impl<T: ?Sized> RwLock<T> {
226226 /// # })
227227 /// ```
228228 pub async fn write ( & self ) -> RwLockWriteGuard < ' _ , T > {
229- pub struct WriteFuture < ' a , T > {
229+ pub struct WriteFuture < ' a , T : ? Sized > {
230230 lock : & ' a RwLock < T > ,
231231 opt_key : Option < usize > ,
232232 }
233233
234- impl < ' a , T > Future for WriteFuture < ' a , T > {
234+ impl < ' a , T : ? Sized > Future for WriteFuture < ' a , T > {
235235 type Output = RwLockWriteGuard < ' a , T > ;
236236
237237 fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
@@ -258,7 +258,7 @@ impl<T: ?Sized> RwLock<T> {
258258 }
259259 }
260260
261- impl < T > Drop for WriteFuture < ' _ , T > {
261+ impl < T : ? Sized > Drop for WriteFuture < ' _ , T > {
262262 fn drop ( & mut self ) {
263263 // If the current task is still in the set, that means it is being cancelled now.
264264 if let Some ( key) = self . opt_key {
0 commit comments