Skip to content

Commit 088a374

Browse files
committed
fix compilation errors
1 parent 352310b commit 088a374

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

sqlx-macros-core/src/derives/attributes.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,6 @@ pub fn check_enum_attributes(input: &DeriveInput) -> syn::Result<SqlxContainerAt
219219
input
220220
);
221221

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-
228222
Ok(attributes)
229223
}
230224

sqlx-macros-core/src/derives/type.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ fn expand_derive_has_sql_type_weak_enum(
127127
input: &DeriveInput,
128128
variants: &Punctuated<Variant, Comma>,
129129
) -> 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();
132132
let ident = &input.ident;
133133
let mut ts = quote!(
134134
#[automatically_derived]
@@ -146,11 +146,11 @@ fn expand_derive_has_sql_type_weak_enum(
146146
}
147147
);
148148

149-
if cfg!(feature = "postgres") && !attributes.no_pg_array {
149+
if cfg!(feature = "postgres") && !attrs.no_pg_array {
150150
ts.extend(quote!(
151151
impl ::sqlx::postgres::PgHasArrayType for #ident {
152152
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()
154154
}
155155
}
156156
));
@@ -199,7 +199,7 @@ fn expand_derive_has_sql_type_strong_enum(
199199
tts.extend(quote!(
200200
impl ::sqlx::postgres::PgHasArrayType for #ident {
201201
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()
203203
}
204204
}
205205
));

0 commit comments

Comments
 (0)