File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed
sqlx-macros-core/src/derives Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -219,12 +219,6 @@ pub fn check_enum_attributes(input: &DeriveInput) -> syn::Result<SqlxContainerAt
219
219
input
220
220
) ;
221
221
222
- assert_attribute ! (
223
- !attributes. no_pg_array,
224
- "unused #[sqlx(no_pg_array)]; derive does not emit `PgHasArrayType` impls for enums" ,
225
- input
226
- ) ;
227
-
228
222
Ok ( attributes)
229
223
}
230
224
Original file line number Diff line number Diff line change @@ -127,8 +127,8 @@ fn expand_derive_has_sql_type_weak_enum(
127
127
input : & DeriveInput ,
128
128
variants : & Punctuated < Variant , Comma > ,
129
129
) -> syn:: Result < TokenStream > {
130
- let attr = check_weak_enum_attributes ( input, variants) ?;
131
- let repr = attr . repr . unwrap ( ) ;
130
+ let attrs = check_weak_enum_attributes ( input, variants) ?;
131
+ let repr = attrs . repr . unwrap ( ) ;
132
132
let ident = & input. ident ;
133
133
let mut ts = quote ! (
134
134
#[ automatically_derived]
@@ -146,11 +146,11 @@ fn expand_derive_has_sql_type_weak_enum(
146
146
}
147
147
) ;
148
148
149
- if cfg ! ( feature = "postgres" ) && !attributes . no_pg_array {
149
+ if cfg ! ( feature = "postgres" ) && !attrs . no_pg_array {
150
150
ts. extend ( quote ! (
151
151
impl :: sqlx:: postgres:: PgHasArrayType for #ident {
152
152
fn array_type_info( ) -> :: sqlx:: postgres:: PgTypeInfo {
153
- <#ty as :: sqlx:: postgres:: PgHasArrayType >:: array_type_info( )
153
+ <#ident as :: sqlx:: postgres:: PgHasArrayType >:: array_type_info( )
154
154
}
155
155
}
156
156
) ) ;
@@ -199,7 +199,7 @@ fn expand_derive_has_sql_type_strong_enum(
199
199
tts. extend ( quote ! (
200
200
impl :: sqlx:: postgres:: PgHasArrayType for #ident {
201
201
fn array_type_info( ) -> :: sqlx:: postgres:: PgTypeInfo {
202
- <#ty as :: sqlx:: postgres:: PgHasArrayType >:: array_type_info( )
202
+ <#ident as :: sqlx:: postgres:: PgHasArrayType >:: array_type_info( )
203
203
}
204
204
}
205
205
) ) ;
You can’t perform that action at this time.
0 commit comments