mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
fix compilation errors
This commit is contained in:
parent
352310ba34
commit
088a374ebb
@ -219,12 +219,6 @@ pub fn check_enum_attributes(input: &DeriveInput) -> syn::Result<SqlxContainerAt
|
||||
input
|
||||
);
|
||||
|
||||
assert_attribute!(
|
||||
!attributes.no_pg_array,
|
||||
"unused #[sqlx(no_pg_array)]; derive does not emit `PgHasArrayType` impls for enums",
|
||||
input
|
||||
);
|
||||
|
||||
Ok(attributes)
|
||||
}
|
||||
|
||||
|
||||
@ -127,8 +127,8 @@ fn expand_derive_has_sql_type_weak_enum(
|
||||
input: &DeriveInput,
|
||||
variants: &Punctuated<Variant, Comma>,
|
||||
) -> syn::Result<TokenStream> {
|
||||
let attr = check_weak_enum_attributes(input, variants)?;
|
||||
let repr = attr.repr.unwrap();
|
||||
let attrs = check_weak_enum_attributes(input, variants)?;
|
||||
let repr = attrs.repr.unwrap();
|
||||
let ident = &input.ident;
|
||||
let mut ts = quote!(
|
||||
#[automatically_derived]
|
||||
@ -146,11 +146,11 @@ fn expand_derive_has_sql_type_weak_enum(
|
||||
}
|
||||
);
|
||||
|
||||
if cfg!(feature = "postgres") && !attributes.no_pg_array {
|
||||
if cfg!(feature = "postgres") && !attrs.no_pg_array {
|
||||
ts.extend(quote!(
|
||||
impl ::sqlx::postgres::PgHasArrayType for #ident {
|
||||
fn array_type_info() -> ::sqlx::postgres::PgTypeInfo {
|
||||
<#ty as ::sqlx::postgres::PgHasArrayType>::array_type_info()
|
||||
<#ident as ::sqlx::postgres::PgHasArrayType>::array_type_info()
|
||||
}
|
||||
}
|
||||
));
|
||||
@ -199,7 +199,7 @@ fn expand_derive_has_sql_type_strong_enum(
|
||||
tts.extend(quote!(
|
||||
impl ::sqlx::postgres::PgHasArrayType for #ident {
|
||||
fn array_type_info() -> ::sqlx::postgres::PgTypeInfo {
|
||||
<#ty as ::sqlx::postgres::PgHasArrayType>::array_type_info()
|
||||
<#ident as ::sqlx::postgres::PgHasArrayType>::array_type_info()
|
||||
}
|
||||
}
|
||||
));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user