@@ -36,56 +36,56 @@ pub fn derive(item: DeriveInput) -> Result<TokenStream> {
3636 let mut to_sql_generics = item. generics . clone ( ) ;
3737 to_sql_generics. params . push ( parse_quote ! ( __DB) ) ;
3838 to_sql_generics. make_where_clause ( ) . predicates . push ( parse_quote ! ( __DB: diesel:: backend:: Backend ) ) ;
39- to_sql_generics. make_where_clause ( ) . predicates . push ( parse_quote ! ( Self : ToSql <#sql_type, __DB>) ) ;
39+ to_sql_generics. make_where_clause ( ) . predicates . push ( parse_quote ! ( Self : diesel :: serialize :: ToSql <#sql_type, __DB>) ) ;
4040 let ( to_sql_impl_generics, _, to_sql_where_clause) = to_sql_generics. split_for_impl ( ) ;
4141
4242 let tokens = quote ! (
43- impl #impl_generics AsExpression <#sql_type>
43+ impl #impl_generics diesel :: expression :: AsExpression <#sql_type>
4444 for & ' __expr #struct_ty #where_clause
4545 {
46- type Expression = Bound <#sql_type, Self >;
46+ type Expression = diesel :: internal :: derives :: as_expression :: Bound <#sql_type, Self >;
4747
48- fn as_expression( self ) -> Self :: Expression {
49- Bound :: new( self )
48+ fn as_expression( self ) -> < Self as diesel :: expression :: AsExpression <#sql_type>> :: Expression {
49+ diesel :: internal :: derives :: as_expression :: Bound :: new( self )
5050 }
5151 }
5252
53- impl #impl_generics AsExpression <Nullable <#sql_type>>
53+ impl #impl_generics diesel :: expression :: AsExpression <diesel :: sql_types :: Nullable <#sql_type>>
5454 for & ' __expr #struct_ty #where_clause
5555 {
56- type Expression = Bound <Nullable <#sql_type>, Self >;
56+ type Expression = diesel :: internal :: derives :: as_expression :: Bound <diesel :: sql_types :: Nullable <#sql_type>, Self >;
5757
58- fn as_expression( self ) -> Self :: Expression {
59- Bound :: new( self )
58+ fn as_expression( self ) -> < Self as diesel :: expression :: AsExpression <diesel :: sql_types :: Nullable <#sql_type>>> :: Expression {
59+ diesel :: internal :: derives :: as_expression :: Bound :: new( self )
6060 }
6161 }
6262
63- impl #impl_generics2 AsExpression <#sql_type>
63+ impl #impl_generics2 diesel :: expression :: AsExpression <#sql_type>
6464 for & ' __expr2 & ' __expr #struct_ty #where_clause2
6565 {
66- type Expression = Bound <#sql_type, Self >;
66+ type Expression = diesel :: internal :: derives :: as_expression :: Bound <#sql_type, Self >;
6767
68- fn as_expression( self ) -> Self :: Expression {
69- Bound :: new( self )
68+ fn as_expression( self ) -> < Self as diesel :: expression :: AsExpression <#sql_type>> :: Expression {
69+ diesel :: internal :: derives :: as_expression :: Bound :: new( self )
7070 }
7171 }
7272
73- impl #impl_generics2 AsExpression <Nullable <#sql_type>>
73+ impl #impl_generics2 diesel :: expression :: AsExpression <diesel :: sql_types :: Nullable <#sql_type>>
7474 for & ' __expr2 & ' __expr #struct_ty #where_clause2
7575 {
76- type Expression = Bound <Nullable <#sql_type>, Self >;
76+ type Expression = diesel :: internal :: derives :: as_expression :: Bound <diesel :: sql_types :: Nullable <#sql_type>, Self >;
7777
78- fn as_expression( self ) -> Self :: Expression {
79- Bound :: new( self )
78+ fn as_expression( self ) -> < Self as diesel :: expression :: AsExpression <diesel :: sql_types :: Nullable <#sql_type>>> :: Expression {
79+ diesel :: internal :: derives :: as_expression :: Bound :: new( self )
8080 }
8181 }
8282
83- impl #to_sql_impl_generics diesel:: serialize:: ToSql <Nullable <#sql_type>, __DB>
83+ impl #to_sql_impl_generics diesel:: serialize:: ToSql <diesel :: sql_types :: Nullable <#sql_type>, __DB>
8484 for #struct_ty #to_sql_where_clause
8585 {
86- fn to_sql<' __b>( & ' __b self , out: & mut Output <' __b, ' _, __DB>) -> serialize:: Result
86+ fn to_sql<' __b>( & ' __b self , out: & mut diesel :: serialize :: Output <' __b, ' _, __DB>) -> diesel :: serialize:: Result
8787 {
88- ToSql :: <#sql_type, __DB>:: to_sql( self , out)
88+ diesel :: serialize :: ToSql :: <#sql_type, __DB>:: to_sql( self , out)
8989 }
9090 }
9191 ) ;
@@ -96,31 +96,28 @@ pub fn derive(item: DeriveInput) -> Result<TokenStream> {
9696 quote ! (
9797 #tokens
9898
99- impl #impl_generics_plain AsExpression <#sql_type> for #struct_ty #where_clause_plain {
100- type Expression = Bound <#sql_type, Self >;
99+ impl #impl_generics_plain diesel :: expression :: AsExpression <#sql_type> for #struct_ty #where_clause_plain {
100+ type Expression = diesel :: internal :: derives :: as_expression :: Bound <#sql_type, Self >;
101101
102- fn as_expression( self ) -> Self :: Expression {
103- Bound :: new( self )
102+ fn as_expression( self ) -> < Self as diesel :: expression :: AsExpression <#sql_type>> :: Expression {
103+ diesel :: internal :: derives :: as_expression :: Bound :: new( self )
104104 }
105105 }
106106
107- impl #impl_generics_plain AsExpression <Nullable <#sql_type>> for #struct_ty #where_clause_plain {
108- type Expression = Bound <Nullable <#sql_type>, Self >;
107+ impl #impl_generics_plain diesel:: expression:: AsExpression <diesel:: sql_types:: Nullable <#sql_type>> for #struct_ty
108+ #where_clause_plain
109+ {
110+ type Expression = diesel:: internal:: derives:: as_expression:: Bound <diesel:: sql_types:: Nullable <#sql_type>, Self >;
109111
110- fn as_expression( self ) -> Self :: Expression {
111- Bound :: new( self )
112+ fn as_expression( self ) -> < Self as diesel :: expression :: AsExpression <diesel :: sql_types :: Nullable <#sql_type>>> :: Expression {
113+ diesel :: internal :: derives :: as_expression :: Bound :: new( self )
112114 }
113115 }
114116 )
115117 }
116118 } ) ;
117119
118120 Ok ( wrap_in_dummy_mod ( quote ! {
119- use diesel:: expression:: AsExpression ;
120- use diesel:: internal:: derives:: as_expression:: Bound ;
121- use diesel:: sql_types:: Nullable ;
122- use diesel:: serialize:: { self , ToSql , Output } ;
123-
124121 #( #tokens) *
125122 } ) )
126123}
0 commit comments