@@ -127,21 +127,13 @@ pub trait SimpleAsyncConnection {
127
127
#[ async_trait:: async_trait]
128
128
pub trait AsyncConnection : SimpleAsyncConnection + Sized + Send {
129
129
/// The future returned by `AsyncConnection::execute`
130
- type ExecuteFuture < ' conn , ' query > : Future < Output = QueryResult < usize > > + Send
131
- where
132
- Self : ' conn ;
130
+ type ExecuteFuture < ' conn , ' query > : Future < Output = QueryResult < usize > > + Send ;
133
131
/// The future returned by `AsyncConnection::load`
134
- type LoadFuture < ' conn , ' query > : Future < Output = QueryResult < Self :: Stream < ' conn , ' query > > > + Send
135
- where
136
- Self : ' conn ;
132
+ type LoadFuture < ' conn , ' query > : Future < Output = QueryResult < Self :: Stream < ' conn , ' query > > > + Send ;
137
133
/// The inner stream returned by `AsyncConnection::load`
138
- type Stream < ' conn , ' query > : Stream < Item = QueryResult < Self :: Row < ' conn , ' query > > > + Send
139
- where
140
- Self : ' conn ;
134
+ type Stream < ' conn , ' query > : Stream < Item = QueryResult < Self :: Row < ' conn , ' query > > > + Send ;
141
135
/// The row type used by the stream returned by `AsyncConnection::load`
142
- type Row < ' conn , ' query > : Row < ' conn , Self :: Backend >
143
- where
144
- Self : ' conn ;
136
+ type Row < ' conn , ' query > : Row < ' conn , Self :: Backend > ;
145
137
146
138
/// The backend this type connects to
147
139
type Backend : Backend ;
@@ -341,4 +333,14 @@ pub trait AsyncConnection: SimpleAsyncConnection + Sized + Send {
341
333
fn transaction_state (
342
334
& mut self ,
343
335
) -> & mut <Self :: TransactionManager as TransactionManager < Self > >:: TransactionStateData ;
336
+
337
+ // These functions allow the associated types (`ExecuteFuture`, `LoadFuture`, etc.) to
338
+ // compile without a `where Self: '_` clause. This is needed the because bound causes
339
+ // lifetime issues when using `transaction()` with generic `AsyncConnection`s.
340
+ //
341
+ // See: https://github.com/rust-lang/rust/issues/87479
342
+ #[ doc( hidden) ]
343
+ fn _silence_lint_on_execute_future ( _: Self :: ExecuteFuture < ' _ , ' _ > ) { }
344
+ #[ doc( hidden) ]
345
+ fn _silence_lint_on_load_future ( _: Self :: LoadFuture < ' _ , ' _ > ) { }
344
346
}
0 commit comments