@@ -66,7 +66,7 @@ pub mod methods {
6666 /// to call `load` from generic code.
6767 ///
6868 /// [`RunQueryDsl`]: super::RunQueryDsl
69- pub trait LoadQuery < ' query , Conn : AsyncConnection , U > {
69+ pub trait LoadQuery < ' query , Conn : AsyncConnection , U > : RunQueryDsl < Conn > {
7070 /// The future returned by [`LoadQuery::internal_load`]
7171 type LoadFuture < ' conn > : Future < Output = QueryResult < Self :: Stream < ' conn > > > + Send
7272 where
@@ -85,7 +85,7 @@ pub mod methods {
8585 Conn : AsyncConnection < Backend = DB > ,
8686 U : Send ,
8787 DB : Backend + ' static ,
88- T : AsQuery + Send + ' query ,
88+ T : AsQuery + RunQueryDsl < Conn > + Send + ' query ,
8989 T :: Query : QueryFragment < DB > + QueryId + Send + ' query ,
9090 T :: SqlType : CompatibleType < U , DB , SqlType = ST > ,
9191 U : FromSqlRow < ST , DB > + Send + ' static ,
@@ -641,7 +641,9 @@ pub trait RunQueryDsl<Conn>: Sized {
641641 }
642642}
643643
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 > { }
645647
646648/// Sugar for types which implement both `AsChangeset` and `Identifiable`
647649///
0 commit comments