Skip to content

Conditional compilation for field attributes does not work #3929

@egormanga

Description

@egormanga

When I do:

#[table(name=test)]
struct Test {
	#[cfg_attr(feature(x), unique)]
	x: i32,
}

I get the same result both without and with the x feature enabled.

cargo expand seems to show only #[unique] come and go, while manually setting this attribute results in a bunch of expected code (UniqueColumn, IndexDesc and friends) generated.

I assume the issue is within the derive macro for SpacetimeType, but don't know where to look specifically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions