anathema icon indicating copy to clipboard operation
anathema copied to clipboard

State proc_macro panics on struct with type field

Open s9tpepper opened this issue 5 months ago • 0 comments

What happened The #[derive(State)] proc macro panics if the struct contains a field named "r#type"

What did you expect to happen The proc macro should not panic on a valid field name.

Steps to reproduce Steps to reproduce the behaviour: Try deriving state like this:

#[derive(State)]
struct Test {
    r#type: Value<String>,
}

Causes:

proc-macro derive panicked
message: `"r#type"` is not a valid identifier
proc-macro panicked: `"r#type"` is not a valid identifier [macro-error]

s9tpepper avatar Aug 24 '25 23:08 s9tpepper