@@ -66,7 +66,7 @@ pub mod methods {
66
66
/// to call `load` from generic code.
67
67
///
68
68
/// [`RunQueryDsl`]: super::RunQueryDsl
69
- pub trait LoadQuery < ' query , Conn : AsyncConnection , U > {
69
+ pub trait LoadQuery < ' query , Conn : AsyncConnection , U > : RunQueryDsl < Conn > {
70
70
/// The future returned by [`LoadQuery::internal_load`]
71
71
type LoadFuture < ' conn > : Future < Output = QueryResult < Self :: Stream < ' conn > > > + Send
72
72
where
@@ -85,7 +85,7 @@ pub mod methods {
85
85
Conn : AsyncConnection < Backend = DB > ,
86
86
U : Send ,
87
87
DB : Backend + ' static ,
88
- T : AsQuery + Send + ' query ,
88
+ T : AsQuery + RunQueryDsl < Conn > + Send + ' query ,
89
89
T :: Query : QueryFragment < DB > + QueryId + Send + ' query ,
90
90
T :: SqlType : CompatibleType < U , DB , SqlType = ST > ,
91
91
U : FromSqlRow < ST , DB > + Send + ' static ,
@@ -641,7 +641,9 @@ pub trait RunQueryDsl<Conn>: Sized {
641
641
}
642
642
}
643
643
644
- impl < T , Conn > RunQueryDsl < Conn > for T { }
644
+ // Note: Match the same types that diesel::RunQueryDsl applies to this
645
+ // seems safe currently, as the trait imposes no restrictions based on Conn, only on T.
646
+ impl < T , Conn > RunQueryDsl < Conn > for T where T : diesel:: RunQueryDsl < Conn > { }
645
647
646
648
/// Sugar for types which implement both `AsChangeset` and `Identifiable`
647
649
///
0 commit comments