-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Derive macro configuration does not support cfg_attr
that expands to multiple attributes
#16818
Comments
I believe I may have just run into this with Rust-Analyzer is reporting the following error when
For anyone hitting this on conditional code like the following: #[cfg_attr(
feature = "sea-query",
derive(EnumIter, DeriveActiveEnum),
sea_orm(
db_type = "String(StringLen::N(64))",
rs_type = "String",
),
)]
pub enum MyEnum {
// ...
} Manually expanding to two separate predicative attributes resolves the issue: #[cfg_attr(feature = "sea-query", derive(EnumIter, DeriveActiveEnum))]
#[cfg_attr(feature = "sea-query", sea_orm(rs_type = "String", db_type = "String(StringLen::N(64))"))]
pub enum MyEnum {
// ...
} I am unsure why this started cropping up only in the most recent version of SeaORM or rust-analyzer for me, but the Rust reference documentation shows that this attribute accepts multiple attributes in its |
Ah, you are running into something differently here. I believe the case where |
#8434 has some more context |
My apologies for posting it to the wrong issue then- but I'm glad I helped catch a subtle bug ^^ |
#16789
The text was updated successfully, but these errors were encountered: